<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Deploy on ICE-ICE-BEAR-BLOG</title><link>https://ice-ice-bear.github.io/tags/deploy/</link><description>Recent content in Deploy on ICE-ICE-BEAR-BLOG</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Thu, 16 Apr 2026 00:00:00 +0900</lastBuildDate><atom:link href="https://ice-ice-bear.github.io/tags/deploy/index.xml" rel="self" type="application/rss+xml"/><item><title>hybrid-image-search-demo Dev Log #15 — Removing Tone Count, Unifying A/B Naming</title><link>https://ice-ice-bear.github.io/posts/2026-04-16-hybrid-search-dev15/</link><pubDate>Thu, 16 Apr 2026 00:00:00 +0900</pubDate><guid>https://ice-ice-bear.github.io/posts/2026-04-16-hybrid-search-dev15/</guid><description>&lt;img src="https://ice-ice-bear.github.io/" alt="Featured image of post hybrid-image-search-demo Dev Log #15 — Removing Tone Count, Unifying A/B Naming" /&gt;&lt;h2 id="overview"&gt;Overview
&lt;/h2&gt;&lt;p&gt;This session focused on fully removing the tone_count system across the entire project and unifying generated image naming to a clean A/B pair. The change touched backend logic, existing DB rows, and the frontend UI, resulting in 7 commits. A deploy environment issue and an angle/lens-only regeneration bug were also fixed along the way.&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://ice-ice-bear.github.io/posts/2026-04-15-hybrid-search-dev14/" &gt;Previous: hybrid-image-search-demo Dev Log #14&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="summary-of-changes"&gt;Summary of Changes
&lt;/h2&gt;&lt;h3 id="why-remove-tone-count"&gt;Why Remove Tone Count?
&lt;/h3&gt;&lt;p&gt;The original design managed the number of tone (color) variants per generation via a &lt;code&gt;tone_count&lt;/code&gt; parameter. In practice, two variants (A and B) were always sufficient. The tone count concept added unnecessary complexity to both the UI and the prompt construction pipeline. This session removes it entirely.&lt;/p&gt;
&lt;pre class="mermaid" style="visibility:hidden"&gt;flowchart LR
 A["Before: tone_count=N"] --&gt;|"Removed"| B["Fixed A/B pair"]
 B --&gt; C["Simpler prompts"]
 B --&gt; D["Cleaner UI labels"]
 B --&gt; E["DB migration"]&lt;/pre&gt;&lt;h3 id="db-migration-alembic"&gt;DB Migration (Alembic)
&lt;/h3&gt;&lt;p&gt;Existing rows in the &lt;code&gt;injection_reason&lt;/code&gt; column carried suffixes like &lt;code&gt;_tone2&lt;/code&gt; or &lt;code&gt;_tone3&lt;/code&gt;. An Alembic migration strips these suffixes from all existing rows. The parsing logic in &lt;code&gt;app_utils.py&lt;/code&gt; was also updated to ignore any lingering suffixes.&lt;/p&gt;
&lt;h3 id="backend-changes"&gt;Backend Changes
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;app_utils.py&lt;/code&gt; — Removed tone_count suffix appending logic; added suffix stripping during parsing&lt;/li&gt;
&lt;li&gt;&lt;code&gt;routes/generation.py&lt;/code&gt; — Removed tone_count parameter&lt;/li&gt;
&lt;li&gt;&lt;code&gt;generation/injection.py&lt;/code&gt; — Removed tone ratio logic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;generation/prompt.py&lt;/code&gt; — Enriched the B variant with more detail in the prompt&lt;/li&gt;
&lt;li&gt;&lt;code&gt;routes/history.py&lt;/code&gt; — Added backward-compatible tone suffix handling for history queries&lt;/li&gt;
&lt;li&gt;&lt;code&gt;schemas.py&lt;/code&gt; — Removed tone_count field&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="frontend-changes"&gt;Frontend Changes
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;App.tsx&lt;/code&gt; — Removed tone count badges, unified to A/B naming&lt;/li&gt;
&lt;li&gt;&lt;code&gt;GeneratedImageDetail.tsx&lt;/code&gt; — Removed tone-related labels&lt;/li&gt;
&lt;li&gt;&lt;code&gt;api.ts&lt;/code&gt; — Removed tone_count parameter&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="anglelens-only-regeneration-fix"&gt;Angle/Lens-Only Regeneration Fix
&lt;/h3&gt;&lt;p&gt;When regenerating with only an angle or lens change (no attribute injection), the prompt was not constructed correctly. This was fixed by explicitly handling the angle/lens-only case in the generation pipeline.&lt;/p&gt;
&lt;h3 id="deploy-script-fix"&gt;Deploy Script Fix
&lt;/h3&gt;&lt;p&gt;The &lt;code&gt;uv&lt;/code&gt; binary installs to &lt;code&gt;~/.local/bin&lt;/code&gt; on EC2, but the deploy script&amp;rsquo;s PATH did not include this directory, causing deployment failures. Fixed by adding it to PATH in the script.&lt;/p&gt;
&lt;h2 id="commit-log"&gt;Commit Log
&lt;/h2&gt;&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th style="text-align: center"&gt;#&lt;/th&gt;
 &lt;th style="text-align: center"&gt;Scope&lt;/th&gt;
 &lt;th style="text-align: left"&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td style="text-align: center"&gt;1&lt;/td&gt;
 &lt;td style="text-align: center"&gt;db&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Alembic migration to strip tone_count suffix from existing injection_reason rows&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td style="text-align: center"&gt;2&lt;/td&gt;
 &lt;td style="text-align: center"&gt;gen&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Stop appending tone_count to the reason string&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td style="text-align: center"&gt;3&lt;/td&gt;
 &lt;td style="text-align: center"&gt;history&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Strip tone_count suffix before parsing category from reason&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td style="text-align: center"&gt;4&lt;/td&gt;
 &lt;td style="text-align: center"&gt;ui&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Remove tone count badge from cards, use A/B only&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td style="text-align: center"&gt;5&lt;/td&gt;
 &lt;td style="text-align: center"&gt;ui&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Replace remaining tone labels with A/B naming&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td style="text-align: center"&gt;6&lt;/td&gt;
 &lt;td style="text-align: center"&gt;deploy&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Add ~/.local/bin to PATH for uv on EC2&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td style="text-align: center"&gt;7&lt;/td&gt;
 &lt;td style="text-align: center"&gt;gen&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Remove tone ratio entirely, fix angle/lens-only regen, enrich B variant detail&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="insights"&gt;Insights
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Incremental removal is safer&lt;/strong&gt; — Rather than deleting tone_count in one massive commit, the work was split into DB migration, backend logic, then frontend. Each step could be verified for backward compatibility with existing data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A/B beats N variants&lt;/strong&gt; — From a user perspective, &amp;ldquo;A / B&amp;rdquo; is far more intuitive than &amp;ldquo;Tone 3 images.&amp;rdquo; Reducing choice complexity improves UX.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PATH differences between dev and prod&lt;/strong&gt; — A classic failure mode: works locally but breaks on EC2. Explicitly setting PATH in deploy scripts is a habit worth building.&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>