<?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: Duck duck builder </title>
    <description>The latest articles on DEV Community by Duck duck builder  (@intern_sui_d06f08008bab28).</description>
    <link>https://dev.to/intern_sui_d06f08008bab28</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%2F4236730%2Fab866366-170e-4594-8611-47dc9068c212.png</url>
      <title>DEV Community: Duck duck builder </title>
      <link>https://dev.to/intern_sui_d06f08008bab28</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/intern_sui_d06f08008bab28"/>
    <language>en</language>
    <item>
      <title>Closing the AI Coding Agent Loop with Hand-Drawn Pins and Kane CLI</title>
      <dc:creator>Duck duck builder </dc:creator>
      <pubDate>Thu, 19 Nov 2026 14:13:53 +0000</pubDate>
      <link>https://dev.to/intern_sui_d06f08008bab28/closing-the-ai-coding-agent-loop-with-hand-drawn-pins-and-kane-cli-4i81</link>
      <guid>https://dev.to/intern_sui_d06f08008bab28/closing-the-ai-coding-agent-loop-with-hand-drawn-pins-and-kane-cli-4i81</guid>
      <description>&lt;p&gt;Hi there,&lt;/p&gt;

&lt;p&gt;I’m Harry. I built this little UI check tool for myself, and for you, as my entry for &lt;strong&gt;#KaneCLIHackday&lt;/strong&gt; with &lt;strong&gt;TestMu AI&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The rules are simple: &lt;strong&gt;pin, check, fix and ship&lt;/strong&gt;. Flow every UI bug from a quick pin to a passing check. That’s why it’s called &lt;strong&gt;pinflow&lt;/strong&gt;: &lt;code&gt;pin + flow&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I dislike writing long test scripts for every visual bug, so you don’t have to. When something looks broken on screen, drop a pin and leave a short note. When you save, Kane CLI checks it in a real browser for you.&lt;/p&gt;

&lt;p&gt;One more rule, on purpose: if a check fails, the trace flows back to your coding agent on its own. Same after every edit. It nudges you to ship what actually works on screen, not what you assumed was fine.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Live Demo&lt;/strong&gt;: &lt;a href="https://harrymove-ctrl.github.io/pinflow/" rel="noopener noreferrer"&gt;https://harrymove-ctrl.github.io/pinflow/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository (MIT)&lt;/strong&gt;: &lt;a href="https://github.com/harrymove-ctrl/pinflow" rel="noopener noreferrer"&gt;https://github.com/harrymove-ctrl/pinflow&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;60s Demo Video on X&lt;/strong&gt;: &lt;a href="https://x.com/harry_phan06/status/2123407982851674246" rel="noopener noreferrer"&gt;https://x.com/harry_phan06/status/2123407982851674246&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The bug that unit tests kept missing
&lt;/h2&gt;

&lt;p&gt;When iterating on dense dashboards and automation editors with coding agents, isolated unit tests in jsdom pass easily while real &lt;code&gt;390x844&lt;/code&gt; mobile viewports ship broken.&lt;/p&gt;

&lt;p&gt;In my own workflow dashboards, four real regressions kept slipping through:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A sticky &lt;code&gt;9.5rem&lt;/code&gt; side rail squeezed the content column on &lt;code&gt;390px&lt;/code&gt; phones (&lt;code&gt;532px&lt;/code&gt; scrollWidth inside a &lt;code&gt;364px&lt;/code&gt; container, causing &lt;code&gt;+168px&lt;/code&gt; of horizontal overflow).&lt;/li&gt;
&lt;li&gt;Right-side outcome badges (&lt;code&gt;+$0.48&lt;/code&gt;, &lt;code&gt;VETO 2&lt;/code&gt;, &lt;code&gt;VETO 0&lt;/code&gt;) clipped straight past the viewport edge.&lt;/li&gt;
&lt;li&gt;Entry markers on the 30D Macro candlestick strip piled on top of each other (&lt;code&gt;6&lt;/code&gt; colliding SVG circles).&lt;/li&gt;
&lt;li&gt;Protected safety gates could accidentally be deleted during flow edits, or internal strategy formulas leaked to guest roles.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How pinflow works inside &lt;code&gt;/studio&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;pinflow&lt;/code&gt; (React, TypeScript, Vite, Tailwind) is organized into four practical views you can try immediately in the live browser build:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Automation Flow Canvas (&lt;code&gt;/studio?tab=canvas&lt;/code&gt;)&lt;/strong&gt;: A monochrome dotted canvas with 1:1 pointer card dragging, live SVG connector routing, undo and redo snapshots, role visibility lenses (&lt;code&gt;L0 Guest&lt;/code&gt; redacts internal formulas, &lt;code&gt;L1 Follower&lt;/code&gt;, &lt;code&gt;L3 Operator&lt;/code&gt;), and an immutable safety-gate delete refusal guard.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;390px Mobile Observatory (&lt;code&gt;/studio?tab=mobile&lt;/code&gt;)&lt;/strong&gt;: Reproduces the real &lt;code&gt;9.5rem&lt;/code&gt; sticky-rail squeeze side by side against the stacked full-width fix with green (&lt;code&gt;#10b981&lt;/code&gt;) and red (&lt;code&gt;#ef4444&lt;/code&gt;) 30D Macro candlesticks and five unclipped filter pills (&lt;code&gt;30D&lt;/code&gt;, &lt;code&gt;All (3)&lt;/code&gt;, &lt;code&gt;XAUUSD (2)&lt;/code&gt;, &lt;code&gt;EURUSD (2)&lt;/code&gt;, &lt;code&gt;Safe BE (2)&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hand-Drawn Agentation Compiler (press &lt;code&gt;A&lt;/code&gt;)&lt;/strong&gt;: Click any element on the canvas or 390px frame to sketch a curved ink arrow and short note. &lt;code&gt;pinflow&lt;/code&gt; compiles that note directly into a plain-English &lt;code&gt;.testmuai/tests/*_test.md&lt;/code&gt; Kane CLI test file plus a structured JSON handoff payload.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Closed-Loop Verifier &amp;amp; Candidate Reward Arena (&lt;code&gt;/studio?tab=loop&lt;/code&gt;)&lt;/strong&gt;: Runs real browser checks, compares Candidate A (&lt;code&gt;buggy&lt;/code&gt;, scored &lt;code&gt;24/100&lt;/code&gt;) against Candidate B (&lt;code&gt;fixed&lt;/code&gt;, scored &lt;code&gt;100/100&lt;/code&gt;), and records structured DOM telemetry.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Plain-English Kane CLI specs compiled from visual pins
&lt;/h2&gt;

&lt;p&gt;Instead of hand-maintaining brittle CSS selector chains, every pin compiles into a readable TestMu AI Kane CLI Markdown spec committed directly under &lt;code&gt;.testmuai/tests/&lt;/code&gt;. Here is &lt;code&gt;.testmuai/tests/mobile_390_overflow_test.md&lt;/code&gt; straight from the repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;mode: testing
tags: [pinflow, mobile-390, closed-loop]
variables:
  app_url:
    value: "http://127.0.0.1:4173"

&lt;span class="gu"&gt;# Mobile 390px Layout &amp;amp; 30D Macro Strip Verification
&lt;/span&gt;
&lt;span class="gu"&gt;## Step 1: Open Fixed 390px Mobile Observatory
&lt;/span&gt;Open {{app_url}}/studio?tab=mobile&amp;amp;mode=fixed.
Set viewport to 390x844 mobile portrait.

&lt;span class="gu"&gt;## Step 2: Verify Zero Horizontal Overflow
&lt;/span&gt;Inspect &lt;span class="sb"&gt;`[data-testid="mobile-390-viewport"]`&lt;/span&gt;.
Verify scrollWidth equals clientWidth (0px horizontal overflow) and the dual-account summary bar is visible at the top.

&lt;span class="gu"&gt;## Step 3: Verify Outcome Badges and Filter Strip Are Unclipped
&lt;/span&gt;Inspect all &lt;span class="sb"&gt;`[data-testid="mobile-outcome-badge"]`&lt;/span&gt; pills (&lt;span class="sb"&gt;`+$0.48`&lt;/span&gt;, &lt;span class="sb"&gt;`VETO 2`&lt;/span&gt;, &lt;span class="sb"&gt;`VETO 0`&lt;/span&gt;) and all 5 filter controls (&lt;span class="sb"&gt;`30D`&lt;/span&gt;, &lt;span class="sb"&gt;`All (3)`&lt;/span&gt;, &lt;span class="sb"&gt;`XAUUSD (2)`&lt;/span&gt;, &lt;span class="sb"&gt;`EURUSD (2)`&lt;/span&gt;, &lt;span class="sb"&gt;`Safe BE (2)`&lt;/span&gt;) inside &lt;span class="sb"&gt;`[data-testid="mobile-filter-strip"]`&lt;/span&gt;.
Verify every badge and filter chip fits completely inside the 390px container with zero right-edge clipping.

&lt;span class="gu"&gt;## Step 4: Verify 30D Macro Strip Has Zero Colliding Markers
&lt;/span&gt;Inspect &lt;span class="sb"&gt;`[data-testid="macro-30d-chart"]`&lt;/span&gt;.
Verify every SVG circle marker has &lt;span class="sb"&gt;`data-marker-colliding="false"`&lt;/span&gt;, bullish/bearish candlesticks render in &lt;span class="sb"&gt;`#10b981`&lt;/span&gt; green and &lt;span class="sb"&gt;`#ef4444`&lt;/span&gt; red, and axis labels (&lt;span class="sb"&gt;`21 Oct`&lt;/span&gt;, &lt;span class="sb"&gt;`05 Nov`&lt;/span&gt;, &lt;span class="sb"&gt;`19 Nov`&lt;/span&gt;) remain legible.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The repository ships with three committed specs covering mobile overflow, safety-gate delete refusal (&lt;code&gt;safety_gate_refusal_test.md&lt;/code&gt;), and hand-drawn pin compilation (&lt;code&gt;agentation_compile_test.md&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing the loop automatically with a &lt;code&gt;PostToolUse&lt;/code&gt; hook
&lt;/h2&gt;

&lt;p&gt;Running a browser check once is helpful, but wiring its failure output straight back into the coding agent is what stops regressions from shipping.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;.claude/settings.json&lt;/code&gt;, &lt;code&gt;pinflow&lt;/code&gt; attaches &lt;code&gt;scripts/agent-post-edit-hook.mjs&lt;/code&gt; to &lt;code&gt;PostToolUse&lt;/code&gt; on every &lt;code&gt;Edit&lt;/code&gt; or &lt;code&gt;Write&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"PostToolUse"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Edit|Write"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"node scripts/agent-post-edit-hook.mjs"&lt;/span&gt;
          &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When &lt;code&gt;scripts/kane-loop.mjs&lt;/code&gt; runs real browser checks (emitting TestMu AI &lt;code&gt;--agent&lt;/code&gt; NDJSON, or invoking &lt;code&gt;kane-cli testmd run &amp;lt;spec&amp;gt; --agent&lt;/code&gt; directly with &lt;code&gt;--engine kane&lt;/code&gt;), any failure writes the exact DOM geometry measurements to &lt;code&gt;.testmuai/last-failure-handoff.md&lt;/code&gt; and &lt;code&gt;.testmuai/last-failure-handoff.json&lt;/code&gt;. The hook then prints the failure trace to &lt;code&gt;stderr&lt;/code&gt; and exits with code &lt;code&gt;2&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exitCode&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;handoff&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;existsSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;HANDOFF_MD&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;HANDOFF_MD&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"utf8"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Browser verification failed. Inspect Kane CLI NDJSON output above."&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`\n[pinflow closed-loop hook] Verification blocked commit:\n${handoff}\n`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because the hook exits with code &lt;code&gt;2&lt;/code&gt;, the coding agent does not stop on a broken layout. It reads the exact overflow pixels and clipped badge count, patches the stacked layout, and re-runs verification until Round 2 returns exit &lt;code&gt;0&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measured Round 1 vs Round 2 verification
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check (&lt;code&gt;390x844&lt;/code&gt; real Chromium)&lt;/th&gt;
&lt;th&gt;Round 1 (Candidate A, Buggy)&lt;/th&gt;
&lt;th&gt;Round 2 (Candidate B, Fixed)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Container width vs scrollWidth&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;532px&lt;/code&gt; inside &lt;code&gt;364px&lt;/code&gt; (&lt;code&gt;+168px&lt;/code&gt; overflow)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;364px&lt;/code&gt; inside &lt;code&gt;364px&lt;/code&gt; (&lt;code&gt;0px&lt;/code&gt; overflow)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Right-side outcome badges clipped&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;3&lt;/code&gt; clipped (&lt;code&gt;+$0.48&lt;/code&gt;, &lt;code&gt;VETO 2&lt;/code&gt;, &lt;code&gt;VETO 0&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0&lt;/code&gt; clipped&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;30D Macro filter chips clipped&lt;/td&gt;
&lt;td&gt;Overflowed container&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0&lt;/code&gt; clipped (all &lt;code&gt;5&lt;/code&gt; visible)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Colliding 30D chart entry markers&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;6&lt;/code&gt; overlapping circles&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0&lt;/code&gt; overlaps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Safety-gate delete refusal &amp;amp; L0 redaction&lt;/td&gt;
&lt;td&gt;Verified intact&lt;/td&gt;
&lt;td&gt;Verified intact&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Candidate Reward Arena score&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;24 / 100&lt;/code&gt; (Rejected, exit &lt;code&gt;1&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;100 / 100&lt;/code&gt; (Promoted, exit &lt;code&gt;0&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Try it locally in 3 commands
&lt;/h2&gt;

&lt;p&gt;You can explore the UI right now at &lt;a href="https://harrymove-ctrl.github.io/pinflow/" rel="noopener noreferrer"&gt;https://harrymove-ctrl.github.io/pinflow/&lt;/a&gt; (which ships with bundled verified run evidence) or run the full closed loop on your machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/harrymove-ctrl/pinflow.git
&lt;span class="nb"&gt;cd&lt;/span&gt; pinflow
pnpm install
pnpm run kane:loop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To run the committed Markdown test specs directly through TestMu AI Kane CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install -g @testmuai/kane-cli
kane-cli login
pnpm build &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; pnpm preview --host 127.0.0.1 --port 4173 &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;
kane-cli testmd run .testmuai/tests/mobile_390_overflow_test.md --agent
kane-cli testmd run .testmuai/tests/safety_gate_refusal_test.md --agent
kane-cli testmd run .testmuai/tests/agentation_compile_test.md --agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s all. I hope you like it, and I’d love to hear how you are wiring real browser verification into your own coding-agent loops for &lt;code&gt;#KaneCLIHackday&lt;/code&gt;!&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>cli</category>
      <category>testing</category>
    </item>
    <item>
      <title>Mira: The Money Friend You Text Before You Buy</title>
      <dc:creator>Duck duck builder </dc:creator>
      <pubDate>Tue, 10 Nov 2026 11:13:37 +0000</pubDate>
      <link>https://dev.to/intern_sui_d06f08008bab28/mira-the-money-friend-you-text-before-you-buy-12p9</link>
      <guid>https://dev.to/intern_sui_d06f08008bab28/mira-the-money-friend-you-text-before-you-buy-12p9</guid>
      <description>&lt;h1&gt;
  
  
  Mira: test the buy before you spend the money
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;How Mira uses Tatum and Walrus Memory, and how she learns what you actually care about over time. A Track 3 (Consumer Finance Apps) entry to the Walrus × Tatum "Total Recall" hackathon.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw8kx7uqixqpx8arywgg0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw8kx7uqixqpx8arywgg0.png" alt="Mira: the money friend you text before you buy" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Live:&lt;/strong&gt; &lt;a href="https://mira-flax.vercel.app" rel="noopener noreferrer"&gt;mira-flax.vercel.app&lt;/a&gt; · &lt;strong&gt;Restored Mainnet profile:&lt;/strong&gt; &lt;a href="https://mira-flax.vercel.app/#/chat?me=mira7x9k2p4q8w1n5v3c" rel="noopener noreferrer"&gt;mira-flax.vercel.app/#/chat?me=mira7x9k2p4q8w1n5v3c&lt;/a&gt; · &lt;strong&gt;Code:&lt;/strong&gt; &lt;a href="https://github.com/hien-p/total-recall-mira" rel="noopener noreferrer"&gt;github.com/hien-p/total-recall-mira&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The moment before you buy
&lt;/h2&gt;

&lt;p&gt;Budget apps ask you to do accounting after the money is already gone. At the end of the month they pull a wall of card transactions, leave 47 items in "Uncategorised", and show a pie chart of what went wrong. Most people stop opening them by week two.&lt;/p&gt;

&lt;p&gt;The ten seconds that matter happen earlier, while you are standing in a store or staring at a checkout tab wondering: &lt;em&gt;"should I buy this $48 serum, or keep the money for my Tokyo trip?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Mira is a money friend you text in that ten-second window. There are no spreadsheets, no bank logins, and no wallet popups. You text what you spend the way you would text a friend, ask Mira before you buy something you are on the fence about, and tap once to move the money you chose not to spend into your goal pocket.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0dfw89ply641h9l6iotz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0dfw89ply641h9l6iotz.jpg" alt="Six scenes from Mira: spend tracking, asking before you buy, skipping and saving on Sui via Tatum, writing typed lines to Walrus Memory, adapting impulse thresholds, and restoring on a new phone" width="800" height="675"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What Mira does
&lt;/h2&gt;

&lt;p&gt;Everything happens in one chat thread that feels like iMessage:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Set your plan in plain words.&lt;/strong&gt; You start by texting &lt;code&gt;"budget 400 a month"&lt;/code&gt;, &lt;code&gt;"saving 1200 for tokyo by march"&lt;/code&gt;, and &lt;code&gt;"cap eating out at 60 a week"&lt;/code&gt;. Mira sets your monthly budget, opens a goal pocket for Tokyo with $100 of test spending money, and starts watching your weekly cap.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Text what you spend.&lt;/strong&gt; Send &lt;code&gt;"coffee 5.5"&lt;/code&gt;, &lt;code&gt;"uber 18"&lt;/code&gt;, or &lt;code&gt;"dinner 84 split 3 ways"&lt;/code&gt;. Mira files each spend into one of nine categories (&lt;code&gt;eating out&lt;/code&gt;, &lt;code&gt;groceries&lt;/code&gt;, &lt;code&gt;treats&lt;/code&gt;, &lt;code&gt;transport&lt;/code&gt;, &lt;code&gt;shopping&lt;/code&gt;, &lt;code&gt;beauty&lt;/code&gt;, &lt;code&gt;fun&lt;/code&gt;, &lt;code&gt;bills&lt;/code&gt;, &lt;code&gt;other&lt;/code&gt;), works out your $28 share of the split dinner, and shows what is left of your month and your weekly cap on the receipt card.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask before you buy.&lt;/strong&gt; Text &lt;code&gt;"should i buy the $48 serum?"&lt;/code&gt; before checking out. Mira checks three stores (&lt;code&gt;Shelf&lt;/code&gt; at $41, &lt;code&gt;Basket&lt;/code&gt; at $45, &lt;code&gt;Glow &amp;amp; Co&lt;/code&gt; at $48), checks your budget and caps, recalls what you decided on similar buys from Walrus Memory, and shows what $41 is worth toward your goal (&lt;code&gt;3% of your $1,200 Tokyo trip&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Skip it and move the money.&lt;/strong&gt; On the advice card, tap &lt;code&gt;"skip it, move $41 to tokyo"&lt;/code&gt;. Mira moves $41 from your &lt;code&gt;Spending&lt;/code&gt; pocket into your &lt;code&gt;tokyo&lt;/code&gt; pocket on Sui testnet and records that you skipped a $40 beauty buy so she knows where your line is next time.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffowl79leiun7lso74i1q.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffowl79leiun7lso74i1q.jpg" alt="Three steps in the thread: logging daily spends, asking whether to buy the $48 serum, and moving $41 into the Tokyo pocket" width="800" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How it uses Tatum
&lt;/h2&gt;

&lt;p&gt;A consumer finance app loses the user the moment it asks them to install a wallet extension, buy SUI for gas, or sign a hex digest to set $41 aside. In Mira, Sui is the pocket ledger and Tatum is how the server talks to it. Every Sui call goes through &lt;code&gt;@mira/chain&lt;/code&gt; over Tatum's native Sui Testnet gRPC gateway (&lt;code&gt;https://sui-testnet.gateway.tatum.io&lt;/code&gt;) with the &lt;code&gt;x-api-key&lt;/code&gt; header in gRPC metadata. Nothing in the repo calls JSON-RPC.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxr9y5f5wgjnmrpeih9mc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxr9y5f5wgjnmrpeih9mc.jpg" alt="Skip it, save it: moving $41 from Spending to the Tokyo pocket on Sui testnet through Tatum gRPC" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Two pockets on Sui testnet per user.&lt;/strong&gt; We published a custom Move module (&lt;code&gt;mira_cash::cash&lt;/code&gt;, package &lt;a href="https://suiscan.xyz/testnet/object/0x160a224d8627ec9fc50ff2192fb4eb405e9a3de3e72d329199c72cd725d27721" rel="noopener noreferrer"&gt;&lt;code&gt;0x160a224d8627ec9fc50ff2192fb4eb405e9a3de3e72d329199c72cd725d27721&lt;/code&gt;&lt;/a&gt;) with 2 decimals so &lt;code&gt;100&lt;/code&gt; on chain is &lt;code&gt;$1.00&lt;/code&gt;. Each user code deterministically derives two Sui addresses: a &lt;code&gt;Spending&lt;/code&gt; pocket (funded with $100.00 of &lt;code&gt;CASH&lt;/code&gt; when you set your goal) and a &lt;code&gt;Goal&lt;/code&gt; pocket (&lt;code&gt;tokyo&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gas-sponsored moves in about 3 seconds.&lt;/strong&gt; When you tap &lt;code&gt;"skip it, move $41 to tokyo"&lt;/code&gt;, the server builds a Programmable Transaction Block that splits and transfers &lt;code&gt;4100&lt;/code&gt; units of &lt;code&gt;CASH&lt;/code&gt; from &lt;code&gt;Spending&lt;/code&gt; to &lt;code&gt;Goal&lt;/code&gt;, sponsors the SUI gas from the operator keypair, signs for both addresses, simulates the transaction, executes it, and polls until &lt;code&gt;status.success === true&lt;/code&gt;. A $41 skip moves $41.00 to the cent, and every receipt card links to the settled transaction on Suiscan.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Five Tatum gRPC methods, paced and counted.&lt;/strong&gt; &lt;code&gt;@mysten/sui&lt;/code&gt;'s &lt;code&gt;SuiGrpcClient&lt;/code&gt; defaults to &lt;code&gt;grpc-web&lt;/code&gt;, while Tatum's Sui gateway speaks native HTTP/2 gRPC, so we paired &lt;code&gt;SuiGrpcClient&lt;/code&gt; with &lt;code&gt;@protobuf-ts/grpc-transport&lt;/code&gt; and &lt;code&gt;@grpc/grpc-js&lt;/code&gt;. Every pocket action uses five gRPC calls:

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;StateService/GetBalance&lt;/code&gt; reads the live &lt;code&gt;CASH&lt;/code&gt; balance in your &lt;code&gt;Spending&lt;/code&gt; and &lt;code&gt;Goal&lt;/code&gt; pockets.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;StateService/ListOwnedObjects&lt;/code&gt; selects &lt;code&gt;Coin&amp;lt;CASH&amp;gt;&lt;/code&gt; objects for transfers and picks the operator's SUI gas coin.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;LedgerService/GetObject&lt;/code&gt; reads the &lt;code&gt;TreasuryCap&lt;/code&gt; shared version at startup.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TransactionExecutionService/SimulateTransaction&lt;/code&gt; dry-runs the transfer and computes gas before signing.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TransactionExecutionService/ExecuteTransaction&lt;/code&gt; and &lt;code&gt;LedgerService/GetTransaction&lt;/code&gt; broadcast the signed transaction and confirm finality.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rate-limited and visible in the UI.&lt;/strong&gt; The client paces calls to 3 per second, retries &lt;code&gt;429&lt;/code&gt; responses, caches pocket balances for 10 seconds (invalidated on any move), and falls back to the public Sui testnet gRPC endpoint if Tatum returns &lt;code&gt;402&lt;/code&gt;. You can open &lt;strong&gt;Under the hood&lt;/strong&gt; in the app at any time to see the live per-method Tatum call counts.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How it uses Walrus Memory
&lt;/h2&gt;

&lt;p&gt;Two facts about Walrus Memory shaped Mira's design from day one: memories on Walrus cannot be deleted, and the relayer sees plaintext before encrypting blobs for storage. Putting raw bank descriptions, exact dollar amounts, or friends' names (&lt;code&gt;"dinner with An &amp;amp; Bao $28.00"&lt;/code&gt;) into permanent storage would violate a user's privacy.&lt;/p&gt;

&lt;p&gt;Mira solves this by splitting state across a strict boundary (&lt;a href="https://github.com/hien-p/total-recall-mira/blob/main/docs/adr/0003-ledger-on-device-typed-lines-in-memory.md" rel="noopener noreferrer"&gt;ADR-0003&lt;/a&gt;): &lt;strong&gt;exact numbers and names stay on your phone, while rounded lessons go to Walrus Memory on mainnet.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4wi3miez01dru23nmgd0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4wi3miez01dru23nmgd0.jpg" alt="Exact numbers stay on your phone while typed, rounded lessons travel on Walrus Memory" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Seven typed line formats, built only on the server.&lt;/strong&gt; The browser never sends free text to Walrus. When you set a plan, teach Mira a rule, or answer a buy nudge, the server builds a typed &lt;code&gt;MemoryFact&lt;/code&gt;, rounds dollar amounts to the nearest $5 under $50 or $10 from $50 up (&lt;code&gt;$41&lt;/code&gt; becomes &lt;code&gt;about $40&lt;/code&gt;), checks category and goal names against closed allowlists, and formats one canonical line:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BUDGET · monthly · about $400 · as_of=2026-11-03T09:15:00Z
GOAL · trip · about $1,200 · by 2027-03 · as_of=2026-11-03T09:16:00Z
CAP · eating out · about $60 a week · as_of=2026-11-03T09:18:00Z
RULE · coffee → eating out · as_of=2026-11-04T14:20:00Z
NUDGE · beauty · about $40 · skipped · as_of=2026-11-05T19:40:00Z
HABIT · eating out · about $55 a week · fri sat · as_of=2026-11-09T12:00:00Z
MONTH · 2026-11 · spent about $250 · as_of=2026-11-09T21:00:00Z
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Four owner-scoped namespaces per user.&lt;/strong&gt; Each user code gets four namespaces inside Mira's mainnet account (&lt;code&gt;mira:prefs:&amp;lt;user&amp;gt;&lt;/code&gt;, &lt;code&gt;mira:rules:&amp;lt;user&amp;gt;&lt;/code&gt;, &lt;code&gt;mira:nudges:&amp;lt;user&amp;gt;&lt;/code&gt;, and &lt;code&gt;mira:habits:&amp;lt;user&amp;gt;&lt;/code&gt;). Writes go through &lt;code&gt;rememberBulk&lt;/code&gt; with a deterministic idempotency key per batch so retries never duplicate a line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Parsed on recall, newest line per key wins.&lt;/strong&gt; Because memories cannot be deleted, updating a budget or a monthly total means writing a newer line. When Mira recalls a user's four namespaces, every returned text must pass &lt;code&gt;parseMemoryLine&lt;/code&gt; (any line that fails the grammar is dropped), and &lt;code&gt;foldMemories&lt;/code&gt; sorts by &lt;code&gt;as_of&lt;/code&gt; so the latest budget, goal, cap, or rule replaces older ones while keeping the count of replaced lines visible in the UI.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Namespace&lt;/th&gt;
&lt;th&gt;Line Kind&lt;/th&gt;
&lt;th&gt;What Mira Writes&lt;/th&gt;
&lt;th&gt;How It Changes Mira's Next Turn&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mira:prefs:&amp;lt;user&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;BUDGET&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;BUDGET · monthly · about $400&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sets the monthly budget and the &lt;code&gt;"left"&lt;/code&gt; line on every receipt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mira:prefs:&amp;lt;user&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;GOAL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;GOAL · trip · about $1,200 · by 2027-03&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sets the target amount and destination pocket for skip-and-save moves&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mira:prefs:&amp;lt;user&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;CAP&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;CAP · eating out · about $60 a week&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Checked before every spend and every &lt;code&gt;"should I buy?"&lt;/code&gt; in that category&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mira:prefs:&amp;lt;user&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;MONTH&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;MONTH · 2026-11 · spent about $250&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Carries your monthly spend total to a new device when &lt;code&gt;localStorage&lt;/code&gt; is empty&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mira:rules:&amp;lt;user&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;RULE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;RULE · coffee → eating out&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Overrides the default category table on every future matching item&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mira:nudges:&amp;lt;user&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;NUDGE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;NUDGE · beauty · about $40 · skipped&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Moves that category's impulse flag line down by $10 on a skip, or up by $10 on buy anyway&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mira:habits:&amp;lt;user&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;HABIT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;HABIT · eating out · about $55 a week · fri sat&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Summarises weekly rhythm once a category reaches 3 logged spends&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  How it learned over time
&lt;/h2&gt;

&lt;p&gt;The point of memory is that Mira acts differently on turn ten than she did on turn one, and tells you which memory changed her answer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F094qq43qc9p4q9c5uk32.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F094qq43qc9p4q9c5uk32.jpg" alt="Memories that change what Mira does next: skipping a $40 serum lowers the beauty flag line to $30, catching a $32 lipstick next time" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Rules you teach her (&lt;code&gt;RULE&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;On your first coffee (&lt;code&gt;"coffee 5.5"&lt;/code&gt;), Mira uses her built-in keyword table and files it under &lt;code&gt;treats&lt;/code&gt;. When you reply &lt;code&gt;"coffee counts as eating out"&lt;/code&gt;, she moves that coffee into &lt;code&gt;eating out&lt;/code&gt; and writes &lt;code&gt;RULE · coffee → eating out&lt;/code&gt; to &lt;code&gt;mira:rules:&amp;lt;user&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;When you text &lt;code&gt;"coffee 4"&lt;/code&gt; the next day, Mira checks recalled rules before the default table, files it under &lt;code&gt;eating out&lt;/code&gt;, counts the $4 toward your $60 weekly eating-out cap, and cites the rule on the receipt card: &lt;code&gt;🧠 eating out, from memory: coffee → eating out&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Your impulse line per category (&lt;code&gt;NUDGE&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Mira starts every category with a default impulse flag line of &lt;strong&gt;$40&lt;/strong&gt;. Each time you answer a &lt;code&gt;"should I buy?"&lt;/code&gt; card, she writes a &lt;code&gt;NUDGE&lt;/code&gt; line to &lt;code&gt;mira:nudges:&amp;lt;user&amp;gt;&lt;/code&gt; and recomputes that category's threshold (&lt;code&gt;$40 - $10 × skips + $10 × bought_anyway&lt;/code&gt;, clamped between $20 and $100):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Skipping pulls the flag line down.&lt;/strong&gt; You ask &lt;code&gt;"should i buy the $48 serum?"&lt;/code&gt; ($41 at Shelf). Because $41 is above the initial $40 line, Mira flags it (&lt;code&gt;"$40 and up is where beauty buys turn impulsive"&lt;/code&gt;) and offers &lt;code&gt;"skip it, move $41 to tokyo"&lt;/code&gt;. You skip it. Mira writes &lt;code&gt;NUDGE · beauty · about $40 · skipped&lt;/code&gt;, which lowers your beauty flag line from &lt;strong&gt;$40 to $30&lt;/strong&gt; (and after a second skipped beauty buy of about $30, down to &lt;strong&gt;$20&lt;/strong&gt;). When you later ask &lt;code&gt;"thinking about a 38 lipstick"&lt;/code&gt; ($32 at Basket), a $32 item that would have passed unflagged on day one now gets caught, and Mira tells you why: &lt;em&gt;"You skipped a beauty buy of about $40, so I flag beauty from $30."&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Buying anyway pushes the flag line up.&lt;/strong&gt; In &lt;code&gt;shopping&lt;/code&gt;, two nudges around $45 and $50 were answered with &lt;code&gt;"buy anyway"&lt;/code&gt; (&lt;code&gt;NUDGE · shopping · about $45 · bought anyway&lt;/code&gt; and &lt;code&gt;NUDGE · shopping · about $50 · bought anyway&lt;/code&gt;). Those two overrides raise the &lt;code&gt;shopping&lt;/code&gt; flag line from &lt;strong&gt;$40 to $60&lt;/strong&gt;, so Mira stops flagging $45 shopping buys you consistently choose to make.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  3. New phone, same Mira (&lt;code&gt;MONTH&lt;/code&gt; + QR restore)
&lt;/h3&gt;

&lt;p&gt;Click &lt;strong&gt;Continue on your phone&lt;/strong&gt; in the desktop header (or open &lt;a href="https://mira-flax.vercel.app/#/chat?me=mira7x9k2p4q8w1n5v3c" rel="noopener noreferrer"&gt;&lt;code&gt;mira-flax.vercel.app/#/chat?me=mira7x9k2p4q8w1n5v3c&lt;/code&gt;&lt;/a&gt; in a fresh browser window). The new device has an empty &lt;code&gt;localStorage&lt;/code&gt;: none of your itemised coffee or dinner receipts leave the old phone.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F65fyifghhqg30urtorzj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F65fyifghhqg30urtorzj.jpg" alt="New phone, same Mira: scanning the QR code restores 9 lines from Walrus Memory and reads pocket balances from Sui testnet through Tatum" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On boot, the new phone recalls all four Walrus Memory namespaces for your code and reads your Sui pockets through Tatum. Within two seconds, Mira greets you with your $400 monthly budget, your $1,200 trip goal, your weekly eating-out and monthly beauty caps, your &lt;code&gt;coffee → eating out&lt;/code&gt; and &lt;code&gt;matcha → treats&lt;/code&gt; rules, your learned $20 beauty flag line and $60 shopping flag line, and &lt;code&gt;MONTH · 2026-11 · spent about $250&lt;/code&gt; so your $150 remaining November budget is ready before you send a single message.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftkrfsf3atuep4gotcpe6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftkrfsf3atuep4gotcpe6.jpg" alt="Live Mira desktop view showing the restored chat thread alongside all 12 recalled Walrus Mainnet memories" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Twelve verified memories on Walrus Mainnet
&lt;/h3&gt;

&lt;p&gt;All 12 lines below are stored on Walrus Mainnet under Mira's account (&lt;code&gt;0x8002385943aeb7c275e29c0cb5e839ad7b8c741dd5ac09871db489712abf971c&lt;/code&gt;, delegate agent &lt;code&gt;55d4532f1a58bc5b03062f7ff075b3d57ec8b920f1f71bb0458093ba4cc43746&lt;/code&gt;) and can be read directly from the Walrus Mainnet aggregator:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Namespace&lt;/th&gt;
&lt;th&gt;Stored Memory Line&lt;/th&gt;
&lt;th&gt;Walrus Mainnet Blob ID&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mira:prefs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;BUDGET · monthly · about $400 · as_of=2026-11-03T09:15:00Z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://aggregator.walrus-mainnet.walrus.space/v1/blobs/MR0RUsnOALRnkTGI0I6j9KgkSG3EJet5NzF87InaLss" rel="noopener noreferrer"&gt;&lt;code&gt;MR0RUsnOALRnkTGI0I6j9KgkSG3EJet5NzF87InaLss&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mira:prefs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;GOAL · trip · about $1,200 · by 2027-03 · as_of=2026-11-03T09:16:00Z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://aggregator.walrus-mainnet.walrus.space/v1/blobs/oY7mz9eTNkOOckfkuZfWvNhsMaSqUZZwPmtVWGI4TUM" rel="noopener noreferrer"&gt;&lt;code&gt;oY7mz9eTNkOOckfkuZfWvNhsMaSqUZZwPmtVWGI4TUM&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mira:prefs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;CAP · eating out · about $60 a week · as_of=2026-11-03T09:18:00Z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://aggregator.walrus-mainnet.walrus.space/v1/blobs/XhVdbCaLkQ71KFg_Wi-t8vosMtST0f76gyPMTtLkoZE" rel="noopener noreferrer"&gt;&lt;code&gt;XhVdbCaLkQ71KFg_Wi-t8vosMtST0f76gyPMTtLkoZE&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mira:prefs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;CAP · beauty · about $80 a month · as_of=2026-11-04T11:05:00Z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://aggregator.walrus-mainnet.walrus.space/v1/blobs/l5Y-rQtzE0w_AbQxLn2arg9-ukSNBzL__pj1NOGRcw4" rel="noopener noreferrer"&gt;&lt;code&gt;l5Y-rQtzE0w_AbQxLn2arg9-ukSNBzL__pj1NOGRcw4&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mira:rules&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;RULE · coffee → eating out · as_of=2026-11-04T14:20:00Z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://aggregator.walrus-mainnet.walrus.space/v1/blobs/3Gtpinps05-EM41EJWZiPuUKLMxogpkaeo4biMC4kYs" rel="noopener noreferrer"&gt;&lt;code&gt;3Gtpinps05-EM41EJWZiPuUKLMxogpkaeo4biMC4kYs&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mira:rules&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;RULE · matcha → treats · as_of=2026-11-05T10:12:00Z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://aggregator.walrus-mainnet.walrus.space/v1/blobs/2XWZsAy3qmoUveAJOJ64t3ltXlBsK_dGJxdsDVh6ahE" rel="noopener noreferrer"&gt;&lt;code&gt;2XWZsAy3qmoUveAJOJ64t3ltXlBsK_dGJxdsDVh6ahE&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mira:nudges&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;NUDGE · beauty · about $40 · skipped · as_of=2026-11-05T19:40:00Z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://aggregator.walrus-mainnet.walrus.space/v1/blobs/9XaNh_0kZNnqrf15WVlUMNZW0UvKUjTsDPhOGRIRvaw" rel="noopener noreferrer"&gt;&lt;code&gt;9XaNh_0kZNnqrf15WVlUMNZW0UvKUjTsDPhOGRIRvaw&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mira:nudges&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;NUDGE · beauty · about $30 · skipped · as_of=2026-11-06T20:15:00Z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://aggregator.walrus-mainnet.walrus.space/v1/blobs/Uf5vWF-8lGMjgnjKYrzikA_mRWxbnPHptsGdba2IBCI" rel="noopener noreferrer"&gt;&lt;code&gt;Uf5vWF-8lGMjgnjKYrzikA_mRWxbnPHptsGdba2IBCI&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mira:nudges&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;NUDGE · shopping · about $45 · bought anyway · as_of=2026-11-07T15:30:00Z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://aggregator.walrus-mainnet.walrus.space/v1/blobs/MOp2RXVm7VVEOGA67Ui90uwZ1J8kkVawlH8oEF302vI" rel="noopener noreferrer"&gt;&lt;code&gt;MOp2RXVm7VVEOGA67Ui90uwZ1J8kkVawlH8oEF302vI&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mira:nudges&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;NUDGE · shopping · about $50 · bought anyway · as_of=2026-11-08T17:10:00Z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://aggregator.walrus-mainnet.walrus.space/v1/blobs/5L1fGBjAmkmKh2slzJ_XLSXoeVcKPvEvgv0wa4YT97U" rel="noopener noreferrer"&gt;&lt;code&gt;5L1fGBjAmkmKh2slzJ_XLSXoeVcKPvEvgv0wa4YT97U&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mira:habits&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;HABIT · eating out · about $55 a week · fri sat · as_of=2026-11-09T12:00:00Z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://aggregator.walrus-mainnet.walrus.space/v1/blobs/bYLAyPZTd2i7yv9SkEzcYty46Y1xnI-mkcg7_JtYmJ0" rel="noopener noreferrer"&gt;&lt;code&gt;bYLAyPZTd2i7yv9SkEzcYty46Y1xnI-mkcg7_JtYmJ0&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mira:prefs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;MONTH · 2026-11 · spent about $250 · as_of=2026-11-09T21:00:00Z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://aggregator.walrus-mainnet.walrus.space/v1/blobs/C4Gh5wtYg_BmuBO8DmuWseTP_6p6J_WdWFzJNDBBEfc" rel="noopener noreferrer"&gt;&lt;code&gt;C4Gh5wtYg_BmuBO8DmuWseTP_6p6J_WdWFzJNDBBEfc&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  How it's built
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd6jospe73rv6gm3fetib.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd6jospe73rv6gm3fetib.jpg" alt="Two apps, one memory: React web app on Vercel, Node TypeScript API on Railway, Walrus Memory on Mainnet, and Tatum Sui gRPC on Testnet" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Web (&lt;code&gt;web/&lt;/code&gt;):&lt;/strong&gt; React 18 and Vite on Vercel (&lt;a href="https://mira-flax.vercel.app" rel="noopener noreferrer"&gt;mira-flax.vercel.app&lt;/a&gt;). The phone frame, receipt cards, advice cards, memory drawer, and QR handoff all run against &lt;code&gt;/api/*&lt;/code&gt; on the same origin.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API (&lt;code&gt;server/&lt;/code&gt;):&lt;/strong&gt; Node 24 TypeScript server on Railway with zero framework dependencies. It keeps the Walrus Memory, Tatum, and Sui sponsor keys on the server, formats and validates memory lines, and executes sponsored Sui pocket moves.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Packages (&lt;code&gt;packages/&lt;/code&gt;):&lt;/strong&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;@mira/money&lt;/code&gt;: Pure parser (&lt;code&gt;parseText&lt;/code&gt;), category classifier, advice engine (&lt;code&gt;advise&lt;/code&gt;), and memory fold (&lt;code&gt;foldMemories&lt;/code&gt;, &lt;code&gt;impulseLine&lt;/code&gt;, &lt;code&gt;parseMemoryLine&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;@mira/memory&lt;/code&gt;: Walrus Memory mainnet client (&lt;code&gt;rememberBulk&lt;/code&gt;, &lt;code&gt;recall&lt;/code&gt;), 4-namespace builder, and rate limiter.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;@mira/chain&lt;/code&gt;: Tatum Sui gRPC client, 3 req/sec pacer, call counter, and public fullnode fallback.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mira_cash::cash&lt;/code&gt;: Sui Move contract on testnet for user &lt;code&gt;Spending&lt;/code&gt; and &lt;code&gt;Goal&lt;/code&gt; pockets.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tests and showreel (&lt;code&gt;e2e/&lt;/code&gt;, &lt;code&gt;video/&lt;/code&gt;):&lt;/strong&gt; 91 unit tests across 14 files (&lt;code&gt;npm test&lt;/code&gt;) and a 16-step Playwright browser E2E (&lt;code&gt;npm run e2e&lt;/code&gt;) that walks the entire loop from first budget to new-phone restore. The 2-minute showreel (&lt;code&gt;video/render.ts&lt;/code&gt;) is rendered frame by frame from code at 1080p60 with synthesised sound cues.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Every architecture choice is recorded in &lt;a href="https://github.com/hien-p/total-recall-mira/blob/main/docs/adr/README.md" rel="noopener noreferrer"&gt;&lt;code&gt;docs/adr/&lt;/code&gt;&lt;/a&gt; (ADR-0001 through ADR-0009), and the whole app runs locally in preview mode with a single command (&lt;code&gt;npm run dev&lt;/code&gt;).&lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;User-owned delegate keys:&lt;/strong&gt; Let each user register their own Walrus Memory delegate key on device so the server never holds a shared account key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live price lookups on checkout links:&lt;/strong&gt; Let you paste a product URL into the chat and have Mira pull current prices before checking your category cap and impulse line.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Built for the Walrus × Tatum "Total Recall" hackathon, Track 3: Consumer Finance Apps. MIT licensed. Try it at &lt;a href="https://mira-flax.vercel.app" rel="noopener noreferrer"&gt;mira-flax.vercel.app&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tags: &lt;a class="mentioned-user" href="https://dev.to/tatum_io"&gt;@tatum_io&lt;/a&gt; @WalrusProtocol #Sui #Walrus #Tatum&lt;/em&gt;&lt;/p&gt;

</description>
      <category>walrus</category>
    </item>
  </channel>
</rss>
