<?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: Rounak Vats</title>
    <description>The latest articles on DEV Community by Rounak Vats (@vatsrounak).</description>
    <link>https://dev.to/vatsrounak</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%2F4283605%2F78daf3b8-0611-4477-9bfb-b3e40c34204f.jpg</url>
      <title>DEV Community: Rounak Vats</title>
      <link>https://dev.to/vatsrounak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vatsrounak"/>
    <language>en</language>
    <item>
      <title>How I Used Kiro Specs, Steering, and Hooks to Stitch Excel to the Z3 Theorem Prover (ProofSheet — Kiroween 2026)</title>
      <dc:creator>Rounak Vats</dc:creator>
      <pubDate>Fri, 04 Dec 2026 21:38:33 +0000</pubDate>
      <link>https://dev.to/vatsrounak/how-i-used-kiro-specs-steering-and-hooks-to-stitch-excel-to-the-z3-theorem-prover-proofsheet--44f1</link>
      <guid>https://dev.to/vatsrounak/how-i-used-kiro-specs-steering-and-hooks-to-stitch-excel-to-the-z3-theorem-prover-proofsheet--44f1</guid>
      <description>&lt;p&gt;&lt;em&gt;This post is being written as part of the **Kiroween 2026 hackathon&lt;/em&gt;* (Kiroween Hackathon 2026).*&lt;/p&gt;

&lt;p&gt;Every quarter, RevOps and deal-desk teams ship updated Excel pricing workbooks after spot-checking five or ten sample deals. Everything looks fine — until a real customer hits an edge-case combination of seat tier, annual billing, and referral stacking that quietly blows past a discount cap or sells below gross-margin floor.&lt;/p&gt;

&lt;p&gt;Most modern tools try to audit spreadsheets by pasting formulas into an LLM and hoping it does the math right. For the &lt;strong&gt;Frankenstein&lt;/strong&gt; category at Kiroween 2026, I built &lt;strong&gt;ProofSheet by Aletric&lt;/strong&gt; using the opposite philosophy: stitch the world's most ubiquitous business tool (&lt;strong&gt;Microsoft Excel &lt;code&gt;.xlsx&lt;/code&gt;&lt;/strong&gt;) directly to a formal theorem prover (&lt;strong&gt;Microsoft Z3 SMT solver&lt;/strong&gt;), so pricing policies are mathematically proven rather than guessed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live Demo:&lt;/strong&gt; &lt;a href="https://proofsheet.aletric.com" rel="noopener noreferrer"&gt;https://proofsheet.aletric.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repo (MIT, including &lt;code&gt;.kiro/&lt;/code&gt;):&lt;/strong&gt; &lt;a href="https://github.com/vatsrounak/ProofSheet" rel="noopener noreferrer"&gt;https://github.com/vatsrounak/ProofSheet&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Demo Video (2:37):&lt;/strong&gt; &lt;a href="https://www.youtube.com/watch?v=yaRlLRcpUes" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=yaRlLRcpUes&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Aletric:&lt;/strong&gt; &lt;a href="https://aletric.com" rel="noopener noreferrer"&gt;https://aletric.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Formal Verification Needs Guardrails (And How Kiro Changed My Workflow)
&lt;/h2&gt;

&lt;p&gt;Building a compiler from Excel formulas to Z3 SMT constraints is unforgiving. One floating-point rounding shortcut, one missed division-by-zero branch, or one dropped timeout check can turn a formal verifier into a silent false pass — which is worse than having no verifier at all.&lt;/p&gt;

&lt;p&gt;Using &lt;strong&gt;Kiro&lt;/strong&gt; changed how I approached building this from day one. Instead of vibe-coding features and hoping tests would catch architectural drift later, I used four Kiro primitives together:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Spec-Driven Design Before Code (&lt;code&gt;.kiro/specs/excel-z3-compiler/&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Before writing the compiler, I locked down &lt;code&gt;requirements.md&lt;/code&gt;, &lt;code&gt;design.md&lt;/code&gt;, and checkbox &lt;code&gt;tasks.md&lt;/code&gt; in Kiro. The spec fixed the exact pricing domain (&lt;code&gt;1&lt;/code&gt; to &lt;code&gt;5,000&lt;/code&gt; seats, annual billing, referral — &lt;strong&gt;20,000 discrete deals&lt;/strong&gt;), exact rational representation (cents and basis points), and strict verdict semantics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Violation found&lt;/strong&gt; (with a downloadable &lt;code&gt;*_witness.xlsx&lt;/code&gt; workbook and a minimality proof when Z3 proves no smaller seat count breaks the rule)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verified for the stated inputs&lt;/strong&gt; (&lt;code&gt;UNSAT&lt;/code&gt; across the entire declared domain)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unable to verify&lt;/strong&gt; (returned honestly on unsupported formulas, circular references, or solver timeouts — never a false pass)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. File-Scoped Steering Rules (&lt;code&gt;.kiro/steering/z3-safety.md&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;My favorite Kiro feature on this build was &lt;strong&gt;file-scoped steering&lt;/strong&gt;. Alongside &lt;code&gt;product.md&lt;/code&gt; (always included) and &lt;code&gt;tech.md&lt;/code&gt;, I created &lt;code&gt;.kiro/steering/z3-safety.md&lt;/code&gt; scoped specifically to &lt;code&gt;backend/compiler/**/*.py&lt;/code&gt;. Every time an agent touched compiler code, Kiro automatically enforced four non-negotiable invariants:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Exact rational arithmetic only (no IEEE-754 float drift on boundary thresholds like &lt;code&gt;40.0%&lt;/code&gt; or &lt;code&gt;20.0%&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;A domain-satisfiability pre-check before every policy proof.&lt;/li&gt;
&lt;li&gt;A 3-second solver timeout mapped cleanly to &lt;code&gt;Unable to verify&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Explicit definedness tracking for division-by-zero hazards (catching &lt;code&gt;=100/(B4-250)&lt;/code&gt; failing at &lt;code&gt;250&lt;/code&gt; seats in cell &lt;code&gt;B24&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  3. Automated Verdict Smoke Hook (&lt;code&gt;.kiro/hooks/proofsheet-verdict-smoke.json&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;To make sure no refactor quietly broke an existing verdict, I wired a &lt;code&gt;PostTaskExec&lt;/code&gt; Kiro hook that automatically runs &lt;code&gt;test_verdict_matrix.py&lt;/code&gt; and &lt;code&gt;test_unable.py&lt;/code&gt; after task execution. If a change alters any verdict across the three revisions (&lt;code&gt;original&lt;/code&gt;, &lt;code&gt;cap-only&lt;/code&gt;, &lt;code&gt;repaired&lt;/code&gt;) or breaks an &lt;code&gt;Unable to verify&lt;/code&gt; case, it fails immediately.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Parallel Subagents with Disjoint File Ownership
&lt;/h3&gt;

&lt;p&gt;Once the spec and contracts were locked, I split independent modules across parallel agents — separating the workbook loader from the formula parser, and later splitting the FastAPI backend (&lt;code&gt;backend/web/&lt;/code&gt;), React/Vite UI (&lt;code&gt;frontend/&lt;/code&gt;), deployment setup (&lt;code&gt;Dockerfile&lt;/code&gt;), and regression test suites with clean file ownership.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Real Bug Kiro's Spec Process Caught
&lt;/h2&gt;

&lt;p&gt;Midway through the build, we hit a subtle formal-methods edge case: what if Z3 finds a valid violating deal (&lt;code&gt;SAT&lt;/code&gt;) quickly, but times out on the &lt;em&gt;follow-up&lt;/em&gt; query trying to prove minimality? A naive wrapper would discard the counterexample and return &lt;code&gt;Unable to verify&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We revised the spec and compiler so a valid counterexample is never lost — ProofSheet still returns the violating deal, explicitly labeling it &lt;em&gt;"Counterexample (minimality not proven)"&lt;/em&gt; instead of &lt;em&gt;"Proven minimal deal"&lt;/em&gt;, backed by dedicated regression tests in &lt;code&gt;backend/tests/test_verify_minimization.py&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Shipped
&lt;/h2&gt;

&lt;p&gt;By submission time, ProofSheet shipped as a single Dockerized FastAPI + React/TypeScript web app live at &lt;a href="https://proofsheet.aletric.com" rel="noopener noreferrer"&gt;proofsheet.aletric.com&lt;/a&gt; with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Interactive cell-chain trace&lt;/strong&gt; showing the exact failing deal (&lt;code&gt;101 seats&lt;/code&gt;, annual billing, referral -&amp;gt; &lt;code&gt;$55.00&lt;/code&gt; quote, &lt;code&gt;45.0%&lt;/code&gt; discount, &lt;code&gt;11.2%&lt;/code&gt; margin on &lt;code&gt;original&lt;/code&gt;; &lt;code&gt;18.6%&lt;/code&gt; margin still failing on &lt;code&gt;cap-only&lt;/code&gt;; both policies proven on &lt;code&gt;repaired&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expandable Z3 SMT-LIB v2 proof drawers&lt;/strong&gt; with one-click copy so anyone can replay both the counterexample query and the minimality proof in a fresh Z3 solver.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Downloadable witness &lt;code&gt;.xlsx&lt;/code&gt; workbooks&lt;/strong&gt; with the failing deal pre-filled, ready to inspect in Excel.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1,002 passing backend tests&lt;/strong&gt; (0 failed, 0 skipped — including Hypothesis property-based tests against an independent exact-arithmetic oracle and LibreOffice Calc replay) plus &lt;strong&gt;6 frontend unit tests&lt;/strong&gt; and &lt;strong&gt;5 Playwright E2E tests&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;Next for ProofSheet at &lt;a href="https://aletric.com" rel="noopener noreferrer"&gt;Aletric&lt;/a&gt;: CEGIS Auto-Heal (where an LLM proposes formula repairs while Z3 proves the fix satisfies every policy &lt;em&gt;and&lt;/em&gt; preserves existing compliant deal prices), natural-language rule translation with human confirmation, and a Z3 MCP server.&lt;/p&gt;

&lt;p&gt;Try it live at &lt;strong&gt;&lt;a href="https://proofsheet.aletric.com" rel="noopener noreferrer"&gt;https://proofsheet.aletric.com&lt;/a&gt;&lt;/strong&gt; — and check out the full &lt;code&gt;.kiro/&lt;/code&gt; folder and build log in the &lt;a href="https://github.com/vatsrounak/ProofSheet" rel="noopener noreferrer"&gt;GitHub repo&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  KiroweenHackathon26 #Kiroween #Kiro #Z3 #FormalVerification
&lt;/h1&gt;

</description>
      <category>hackathon</category>
      <category>microsoft</category>
      <category>python</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
