<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hrushi P</title>
    <description>The latest articles on DEV Community by Hrushi P (@hrushiph).</description>
    <link>https://dev.to/hrushiph</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4229504%2F7a23441c-4b1c-4539-b52e-991d2a3680e8.png</url>
      <title>DEV Community: Hrushi P</title>
      <link>https://dev.to/hrushiph</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hrushiph"/>
    <language>en</language>
    <item>
      <title>How We Built FinGarage: Turning Cloud FinOps Invoices into Verified Code Refactors with Switch &amp; Google Antigravity</title>
      <dc:creator>Hrushi P</dc:creator>
      <pubDate>Fri, 06 Nov 2026 02:08:03 +0000</pubDate>
      <link>https://dev.to/hrushiph/how-we-built-fingarage-turning-cloud-finops-invoices-into-verified-code-refactors-with-switch--3i1i</link>
      <guid>https://dev.to/hrushiph/how-we-built-fingarage-turning-cloud-finops-invoices-into-verified-code-refactors-with-switch--3i1i</guid>
      <description>&lt;p&gt;&lt;em&gt;Published for the Flip the Switch Hackathon (WeMakeDevs)&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The $14,487/Month Question Nobody Can Answer Alone
&lt;/h2&gt;

&lt;p&gt;Every month, FinOps teams open their cloud and LLM billing dashboard and see a horror story: a single internal endpoint—&lt;code&gt;GET /orders/summary&lt;/code&gt;—just burned &lt;strong&gt;$14,487.60 in 30 days&lt;/strong&gt; (&lt;code&gt;$0.048292 per request&lt;/code&gt;, nearly &lt;strong&gt;10x over budget&lt;/strong&gt;).&lt;/p&gt;

&lt;p&gt;FinOps files a Jira ticket. Three weeks later, a backend engineer looks at &lt;code&gt;/orders/summary&lt;/code&gt;, sees that all unit tests pass with &lt;code&gt;200 OK&lt;/code&gt;, and has no idea whether the cost spike comes from RDS Provisioned IOPS, LLM tokens, or CloudWatch log ingestion. Worse: if told to &lt;em&gt;"just cut LLM tokens,"&lt;/em&gt; the engineer truncates the prompt to the first 5 rows—cutting the bill by 94%, but &lt;strong&gt;silently breaking refund anomaly detection in production&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We asked a simple question: &lt;strong&gt;What if Finance and Engineering didn't coordinate through stale tickets, but collaborated live inside a Switch Room with deterministic HTTP cost and quality probes?&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Enter FinGarage (&lt;code&gt;#fin-garage&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Using &lt;strong&gt;Switch&lt;/strong&gt; and &lt;strong&gt;Google Antigravity (&lt;code&gt;provider: antigravity&lt;/code&gt;)&lt;/strong&gt;, we built &lt;strong&gt;FinGarage&lt;/strong&gt; around Switch's core architectural strength: &lt;strong&gt;Working Directory Isolation + Shared Room Contracts&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;finops-agent&lt;/code&gt; (&lt;code&gt;./finops-hq&lt;/code&gt;, role: &lt;code&gt;cost-seal-holder&lt;/code&gt;):&lt;/strong&gt; Has exclusive access to &lt;code&gt;invoice_nov_2026.csv&lt;/code&gt;, &lt;code&gt;budget_policy.yaml&lt;/code&gt;, and the black-box verifier &lt;code&gt;probe.py&lt;/code&gt;. It &lt;strong&gt;cannot&lt;/strong&gt; read or modify &lt;code&gt;./checkout-service&lt;/code&gt; code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;dev-agent&lt;/code&gt; (&lt;code&gt;./checkout-service&lt;/code&gt;):&lt;/strong&gt; Has exclusive access to &lt;code&gt;app.py&lt;/code&gt;, &lt;code&gt;db.py&lt;/code&gt;, and &lt;code&gt;llm_engine.py&lt;/code&gt;. It &lt;strong&gt;cannot&lt;/strong&gt; read the invoice or self-certify cost compliance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Neither agent can solve the problem if you turn Switch off.&lt;/p&gt;




&lt;h2&gt;
  
  
  Making Every HTTP Request Carry Its Own Price Tag
&lt;/h2&gt;

&lt;p&gt;First, we instrumented &lt;code&gt;checkout-service&lt;/code&gt; so every response from &lt;code&gt;GET /orders/summary&lt;/code&gt; emits itemized unit-cost telemetry directly in its HTTP headers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;X-Unit-Cost-USD: 0.048292
X-Cost-Breakdown: sql=101($0.0091),llm_tokens=3820($0.0344),logs_kb=43.1($0.0048)
X-Golden-Accuracy-Pct: 100.0
X-FinOps-Receipt: UNVERIFIED-BUDGET-BREACH
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When &lt;code&gt;finops-agent&lt;/code&gt; runs &lt;code&gt;python3 probe.py audit&lt;/code&gt; from &lt;code&gt;./finops-hq&lt;/code&gt;, it correlates the November invoice spike with the exact three code-level anti-patterns in a single &lt;code&gt;#fin-garage&lt;/code&gt; room alert:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;101 SQL queries/request&lt;/strong&gt; (an N+1 customer hydration loop)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3,820 uncached LLM tokens/request&lt;/strong&gt; (re-sending raw JSON rows on every call)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;43.06 KB of logs/request&lt;/strong&gt; (a &lt;code&gt;DEBUG&lt;/code&gt; payload dump inside the hot loop)&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Catching the "Cheap But Wrong" Shortcut Live in &lt;code&gt;#fin-garage&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The most realistic moment in our Switch room happens on &lt;strong&gt;Attempt 1&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;dev-agent&lt;/code&gt; takes a shortcut (&lt;code&gt;naive&lt;/code&gt; mode): it fixes the SQL query and truncates the LLM prompt to 5 rows. Unit cost drops to &lt;code&gt;$0.002742/req&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dev-agent&lt;/code&gt; messages &lt;code&gt;#fin-garage&lt;/code&gt;: &lt;em&gt;"@finops-agent Unit cost is now under $0.0050, please verify!"&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Instead of trusting chat claims (&lt;strong&gt;"Don't Trust Chat, Trust the Probe"&lt;/strong&gt;), &lt;code&gt;finops-agent&lt;/code&gt; runs &lt;code&gt;python3 probe.py verify&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The probe catches that &lt;code&gt;X-Golden-Accuracy-Pct&lt;/code&gt; dropped from &lt;code&gt;100.0%&lt;/code&gt; to &lt;strong&gt;&lt;code&gt;60.0%&lt;/code&gt;&lt;/strong&gt; because truncating tail rows missed &lt;code&gt;refund_anomaly_detected&lt;/code&gt; and &lt;code&gt;payment_retry_detected&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;finops-agent&lt;/code&gt; &lt;strong&gt;refuses the fix in-room&lt;/strong&gt; and blocks receipt minting (&lt;code&gt;PermissionError: GUARDRAIL BLOCKED&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;On &lt;strong&gt;Attempt 2&lt;/strong&gt;, &lt;code&gt;dev-agent&lt;/code&gt; implements the true architectural fix (&lt;code&gt;optimized&lt;/code&gt; mode): a 2-query SQL &lt;code&gt;JOIN&lt;/code&gt; + database-level aggregation, a 340-token semantic-cached digest that preserves all 5 ground-truth facts, and a structured metric counter log.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Payoff: -92.5% Unit Cost, 25.7x Faster, and a Minted Receipt Card
&lt;/h2&gt;

&lt;p&gt;When &lt;code&gt;finops-agent&lt;/code&gt; re-runs &lt;code&gt;probe.py verify&lt;/code&gt; and &lt;code&gt;probe.py mint-receipt&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Unit Cost:&lt;/strong&gt; &lt;code&gt;$0.048292&lt;/code&gt; $\rightarrow$ &lt;strong&gt;&lt;code&gt;$0.003622&lt;/code&gt; (&lt;code&gt;-92.5%&lt;/code&gt;)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Annual Run-Rate Savings:&lt;/strong&gt; &lt;strong&gt;&lt;code&gt;$160,812.00 / year&lt;/code&gt;&lt;/strong&gt; (at 300k requests/month)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Latency:&lt;/strong&gt; &lt;code&gt;1,441 ms&lt;/code&gt; $\rightarrow$ &lt;strong&gt;&lt;code&gt;56 ms&lt;/code&gt; (&lt;code&gt;25.7x&lt;/code&gt; faster)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Golden Accuracy:&lt;/strong&gt; &lt;strong&gt;&lt;code&gt;100.0%&lt;/code&gt; (&lt;code&gt;5/5&lt;/code&gt; facts)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live HTTP Stamp:&lt;/strong&gt; &lt;code&gt;X-FinOps-Receipt: VERIFIED-12c36d84 (-92.5%)&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, &lt;code&gt;finops-agent&lt;/code&gt; updates the Switch Room Document (&lt;code&gt;FinOps Verified Savings Ledger&lt;/code&gt;) and attaches a visual &lt;strong&gt;Itemized FinOps Store Receipt Card&lt;/strong&gt; (&lt;code&gt;receipt_card.png&lt;/code&gt;) directly into &lt;code&gt;#fin-garage&lt;/code&gt; via &lt;code&gt;send_attachment&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>automation</category>
      <category>backend</category>
      <category>cloud</category>
      <category>devchallenge</category>
    </item>
  </channel>
</rss>
