<?xml version="1.0" encoding="utf-8" standalone="yes"?><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>Stalefish Labs</title><link>https://stalefishlabs.com/read/series/building-a-weather-decision-engine/</link><description>A deep dive into the design, architecture, and edge cases behind the Groundwise engine — the shared decision layer that powers Ridewise, Fieldwise, and Yardwise.</description><generator>Hugo 0.155.2</generator><language>en-us</language><lastBuildDate>Tue, 12 May 2026 20:47:00 +0000</lastBuildDate><atom:link href="https://stalefishlabs.com/read/series/building-a-weather-decision-engine/index.xml" rel="self" type="application/rss+xml"/><item><title>Building Confidence Into Uncertain Verdicts</title><link>https://stalefishlabs.com/read/2026-03-27-uncertain-verdicts/</link><pubDate>Fri, 27 Mar 2026 00:00:00 -0700</pubDate><guid>https://stalefishlabs.com/read/2026-03-27-uncertain-verdicts/</guid><description>Why three states beat a percentage, and how a recovery outlook answers the real question: when will it be good?</description><content:encoded>&lt;p&gt;This is the final article in the &lt;a href="https://stalefishlabs.com/read/2026-03-12-weather-engine-intro/"
&gt;Building a Weather Decision Engine&lt;/a&gt; series. The previous articles covered the &lt;a href="https://stalefishlabs.com/read/2026-03-17-drying-model/"
&gt;drying model&lt;/a&gt;, &lt;a href="https://stalefishlabs.com/read/2026-03-20-one-engine-three-apps/"
&gt;multi-app architecture&lt;/a&gt;, &lt;a href="https://stalefishlabs.com/read/2026-03-23-edge-cases/"
&gt;edge cases&lt;/a&gt;, and the &lt;a href="https://stalefishlabs.com/read/2026-03-25-flipping-the-question/"
&gt;Yardwise inversion&lt;/a&gt;. This last one is about the output side, how the engine communicates decisions to people who just want to know if they should go ride.&lt;/p&gt;
&lt;h2 id="why-not-a-percentage"&gt;Why Not a Percentage?&lt;/h2&gt;
&lt;p&gt;The first version of the engine returned a moisture percentage. Users hated it. To be honest I kinda hated it too but it was the first logical thing to represent as meaningful output.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Your trail is at 47% moisture&amp;rdquo; sounds precise. But what do you do with that? Is 47% rideable? It depends on the surface, your tolerance for mud, whether you care about trail damage, and how far you&amp;rsquo;re willing to drive for a &amp;ldquo;maybe.&amp;rdquo; The percentage outsources the decision to the user, which is the entire thing the app was supposed to handle. Besides, I have no idea what percentage tips me one way or the other toward making a real life ride decision.&lt;/p&gt;
&lt;p&gt;A percentage also implies false precision. The engine&amp;rsquo;s moisture model is a reasonable approximation, not a soil sensor reading. Presenting a number with two significant digits suggests an accuracy that doesn&amp;rsquo;t exist, so it&amp;rsquo;s misleading. The difference between 47% and 49% is noise, not signal.&lt;/p&gt;
&lt;p&gt;Three states (&lt;strong&gt;Yes&lt;/strong&gt;, &lt;strong&gt;Maybe&lt;/strong&gt;, &lt;strong&gt;No&lt;/strong&gt;) work because they match how people actually think about the decision. You&amp;rsquo;re either going (Yes), not going (No), or weighing it (Maybe). The engine&amp;rsquo;s job is to put you in the right decision bucket, not to give you a homework problem.&lt;/p&gt;
&lt;h2 id="the-maybe-state-is-the-product"&gt;The Maybe State Is the Product&lt;/h2&gt;
&lt;p&gt;The Yes and No verdicts are straightforward. The real design challenge is Maybe.&lt;/p&gt;
&lt;p&gt;Maybe exists for conditions where reasonable people would disagree. A wetness score of 0.4 on a dirt trail means it&amp;rsquo;s damp but not muddy. Some riders would go. Others would wait. A veteran on a hardtail who likes playing the drift might like the extra challenge of some surprise slip here and there. A flowier rider on a full-suspension with less tire clearance might not want to bother and risk the occasional wet low spot. There&amp;rsquo;s also some variance in trails opening and closing based on conditions, which is another facet of where local knowledge would tip a Maybe verdict one way or the other.&lt;/p&gt;
&lt;p&gt;The engine can&amp;rsquo;t make that call for you. What it &lt;em&gt;can&lt;/em&gt; do is tell you &lt;strong&gt;why&lt;/strong&gt; conditions are borderline, so you can apply your own judgment.&lt;/p&gt;
&lt;h2 id="rationale-the-why-behind-the-verdict"&gt;Rationale: The Why Behind the Verdict&lt;/h2&gt;
&lt;p&gt;Every assessment includes a structured rationale:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-swift" data-lang="swift"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;struct&lt;/span&gt; &lt;span class="nc"&gt;GroundwiseRationale&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;headline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;HeadlineReason&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;decisiveFactor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;DecisiveFactor&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;headlineContext&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;HeadlineContext&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;details&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;DetailReason&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;values&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RationaleValues&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;strong&gt;headline&lt;/strong&gt; is the one-line summary: &amp;ldquo;Light rain still drying&amp;rdquo; or &amp;ldquo;Strong drying clearing moisture&amp;rdquo; or &amp;ldquo;Frozen conditions — ice hazard.&amp;rdquo; It&amp;rsquo;s what the user reads first.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;decisive factor&lt;/strong&gt; identifies the single most important reason for the verdict. This is the tie-breaker — the one variable that, if changed, would flip the result. &amp;ldquo;Recent heavy rain&amp;rdquo; or &amp;ldquo;weak drying conditions&amp;rdquo; or &amp;ldquo;surface sensitivity.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;details&lt;/strong&gt; array provides up to six contributing factors, each describing how a specific weather element is affecting conditions, either positively or negatively. Temperature is helping. Humidity is slowing things down. Wind is moderate. These aren&amp;rsquo;t ranked by importance, they&amp;rsquo;re presented as a set of forces that the user can scan to build their own picture, with the verdict-supporting forces appearing first.&lt;/p&gt;
&lt;p&gt;The engine deliberately avoids showing the raw numbers in the rationale. Users don&amp;rsquo;t need to know that drying strength is 0.53 or that the wetness score is 0.38. They need to know &amp;ldquo;drying conditions are moderate — warm but humid.&amp;rdquo; The rationale translates numbers into plain language.&lt;/p&gt;
&lt;h2 id="confidence-admitting-what-you-dont-know"&gt;Confidence: Admitting What You Don&amp;rsquo;t Know&lt;/h2&gt;
&lt;p&gt;Each verdict has a confidence level — Low, Medium, or High. Don&amp;rsquo;t forget that we&amp;rsquo;re highly dependent on the weather source, and can&amp;rsquo;t control the occasional hiccup where a piece of key data is missing. That&amp;rsquo;s where Confidence enters the picture, and it starts at High and gets reduced by specific factors:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Missing timing data → Low confidence.&lt;/strong&gt; If the engine doesn&amp;rsquo;t know when rain ended (the &lt;code&gt;minutesSinceRainEnded&lt;/code&gt; value is nil), it can&amp;rsquo;t model the timing decay that&amp;rsquo;s central to the wetness calculation. It defaults to a 0.5 timing score (assume moderate concern) and drops confidence to Low. The verdict might be right, but the engine is guessing about a critical input.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Patchy rain → Medium confidence.&lt;/strong&gt; When the weather source indicates precipitation has been spotty and inconsistent (&lt;code&gt;patchyRainLikely&lt;/code&gt;), the actual conditions at the user&amp;rsquo;s spot might differ from what the nearest weather station recorded. The engine can&amp;rsquo;t know whether the rain hit your trail or the parking lot a mile away. These are unknown unknowns, well maybe they&amp;rsquo;re known unknowns&amp;hellip;either way we don&amp;rsquo;t know!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Near-threshold conditions → Medium confidence.&lt;/strong&gt; If the wetness score lands within 0.05 of a verdict boundary (0.25-0.35 near the Yes/Maybe line, or 0.55-0.65 near the Maybe/No line), the engine reduces confidence because a small change in any input could flip the result. This is the engine saying &amp;ldquo;I&amp;rsquo;m calling it Maybe, but it could easily be Yes.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;The confidence level affects how the UI presents the verdict. A High-confidence No is &amp;ldquo;Don&amp;rsquo;t ride — conditions are poor.&amp;rdquo; A Low-confidence Maybe is &amp;ldquo;Conditions are uncertain — check conditions on the ground.&amp;rdquo; Same verdict structure, different emphasis.&lt;/p&gt;
&lt;h3 id="what-i-didnt-do-with-confidence"&gt;What I Didn&amp;rsquo;t Do With Confidence&lt;/h3&gt;
&lt;p&gt;I considered making confidence a continuous value (0-1) or adding more levels. I didn&amp;rsquo;t, for the same reason I use three verdict states instead of a percentage: more granularity creates more decisions for the user without adding useful information. The whole point here is to simplify decision making.&lt;/p&gt;
&lt;p&gt;The three levels map to three communication strategies:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;High:&lt;/strong&gt; Trust the verdict&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Medium:&lt;/strong&gt; The verdict is our best call, but conditions might surprise you&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Low:&lt;/strong&gt; We&amp;rsquo;re short on data, verify on the ground&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That&amp;rsquo;s enough to calibrate expectations without overwhelming.&lt;/p&gt;
&lt;h2 id="recovery-outlook-so-when-will-it-be-good"&gt;Recovery Outlook: &amp;ldquo;So When Will It Be Good?&amp;rdquo;&lt;/h2&gt;
&lt;p&gt;The natural follow-up to a No or Maybe verdict is &amp;ldquo;when will conditions improve?&amp;rdquo; I was initially skeptical about including this but it has turned out to be extremely valuable because as is often the case, I&amp;rsquo;m actually not looking at the app to ride right this moment, I&amp;rsquo;m typically planning ahead for &amp;ldquo;later today.&amp;rdquo; The engine provides a recovery outlook, a qualitative time estimate, to attempt to answer.&lt;/p&gt;
&lt;p&gt;The outlook is a simple 2D lookup: wetness score vs. drying strength.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Wetness / Drying&lt;/th&gt;
&lt;th&gt;Strong&lt;/th&gt;
&lt;th&gt;Moderate&lt;/th&gt;
&lt;th&gt;Weak&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Low (&amp;lt; 0.4)&lt;/td&gt;
&lt;td&gt;Within hours&lt;/td&gt;
&lt;td&gt;A few hours&lt;/td&gt;
&lt;td&gt;Maybe later today&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Medium (0.4-0.6)&lt;/td&gt;
&lt;td&gt;A few hours&lt;/td&gt;
&lt;td&gt;Later today&lt;/td&gt;
&lt;td&gt;Maybe later today&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;High (≥ 0.6)&lt;/td&gt;
&lt;td&gt;Later today&lt;/td&gt;
&lt;td&gt;Maybe later today&lt;/td&gt;
&lt;td&gt;Unlikely today&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The categories are deliberately vague. &amp;ldquo;Within hours&amp;rdquo; means 1-2 hours. &amp;ldquo;Later today&amp;rdquo; means afternoon or evening. &amp;ldquo;Unlikely today&amp;rdquo; means tomorrow at the earliest. The engine doesn&amp;rsquo;t say &amp;ldquo;rideable at 2:47 PM&amp;rdquo; because that precision doesn&amp;rsquo;t exist in the model and it would be ridiculous to pretend that level of accuracy.&lt;/p&gt;
&lt;p&gt;The &amp;ldquo;maybe later today&amp;rdquo; bucket is the uncertainty hedge — conditions might improve, but the engine isn&amp;rsquo;t confident enough to commit. It&amp;rsquo;s the recovery equivalent of the Maybe verdict.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s also a &amp;ldquo;may worsen&amp;rdquo; outlook for cases where the forecast indicates more precipitation. If the next few hours include rain, the engine won&amp;rsquo;t tell you things are improving, even if current drying conditions are strong. This prevents the frustrating experience of waiting for conditions to improve only to get rained on again. And this is fairly common on days where I&amp;rsquo;m pretty sure the trail is day right now but less sure of how the afternoon is going to go. In this regard, the engine isn&amp;rsquo;t just a past weather + surface conditions evaluator, it&amp;rsquo;s also taking a peek into the future (forecast) to give you a sense of if things are trending better, worse, or more of the same.&lt;/p&gt;
&lt;h2 id="risk-categories-more-than-just-wet"&gt;Risk Categories: More Than Just &amp;ldquo;Wet&amp;rdquo;&lt;/h2&gt;
&lt;p&gt;It occurred to me fairly quickly when building Ridewise that what we&amp;rsquo;re dealing with here isn&amp;rsquo;t just the ability to ride, as in muddy or not muddy, but also the risk implications. I&amp;rsquo;m using risk here as a two-way term depending on activity: risk to the user and in some cases risk to the surface. For a concrete skatepark, it&amp;rsquo;s entirely user risk, but for a mountain bike trail or sod soccer field, it&amp;rsquo;s risk to the surface. Actually the mountain bike example might cut both ways but you get the idea. And there&amp;rsquo;s the quality of the activity that I decided was also effectively a risk. So beyond the binary wet/dry question, the engine evaluates three distinct risk categories:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Surface damage&lt;/strong&gt; — Will using this surface in current conditions cause lasting harm? This matters most for natural grass athletic fields (0.9 sensitivity), newly seeded lawns (up to 1.0 with establishment boost), and clay courts (0.85). It matters least for artificial turf (0.05), metal (0.05), and compost (0.3).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Activity safety&lt;/strong&gt; — Is the surface dangerous to use? Wet metal has the highest safety sensitivity (0.95) because it becomes extremely slippery. Composite ramp surfaces like Skatelite and Ramp Armor are also high (0.85), along with metal and concrete. Artificial turf and potting mix are low (0.4) because their textures maintain grip even when wet. Indeed nobody skates on potting mix, but this illustrates how one engine can serve three different apps if you&amp;rsquo;re very careful about the design.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Activity quality&lt;/strong&gt; — Even if it&amp;rsquo;s safe, will the experience be poor? Mud on a dirt trail (0.7 quality sensitivity) makes for a miserable ride. A damp skatepark (0.6) is more debatable, and can range from totally fine (squeegee the ramp and it may dry out) to a complete no-go.&lt;/p&gt;
&lt;p&gt;These three risks are calculated independently and presented alongside the verdict. A Maybe verdict might come with low safety risk but high damage risk — meaning &amp;ldquo;you&amp;rsquo;d be fine riding, but you&amp;rsquo;d rut up the trail.&amp;rdquo; That distinction helps the user make an informed call.&lt;/p&gt;
&lt;h2 id="putting-it-all-together"&gt;Putting It All Together&lt;/h2&gt;
&lt;p&gt;The full assessment output:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-swift" data-lang="swift"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;struct&lt;/span&gt; &lt;span class="nc"&gt;GroundwiseAssessment&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;verdict&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Verdict&lt;/span&gt; &lt;span class="c1"&gt;// Yes / Maybe / No&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;confidence&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Confidence&lt;/span&gt; &lt;span class="c1"&gt;// Low / Medium / High&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;rationale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;GroundwiseRationale&lt;/span&gt; &lt;span class="c1"&gt;// Why&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;riskSurfaceDamage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RiskLevel&lt;/span&gt; &lt;span class="c1"&gt;// Harm to surface&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;riskActivitySafety&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RiskLevel&lt;/span&gt; &lt;span class="c1"&gt;// Danger to user&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;riskActivityQuality&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RiskLevel&lt;/span&gt;&lt;span class="c1"&gt;// Experience quality&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;recoveryOutlook&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RecoveryOutlook&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="c1"&gt;// When will it improve&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The verdict is the headline. Confidence tells you how much to trust it. The rationale explains why. Risk levels add nuance. Recovery outlook answers &amp;ldquo;when?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;None of these fields exist in isolation. Together, they give the user a complete picture in a few seconds of scanning — enough information to make a confident decision without reading a weather report.&lt;/p&gt;
&lt;h2 id="the-design-principle"&gt;The Design Principle&lt;/h2&gt;
&lt;p&gt;The engine&amp;rsquo;s output design follows one principle: &lt;strong&gt;make the decision for the user, then show your work.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Most users will see the verdict color, read the headline, and decide. That&amp;rsquo;s the 80% case, and it should take three seconds. The rationale, risk levels, and recovery outlook are there for the 20% who want to understand why, or who are in a borderline situation where the details matter. And yes, I want wildly overboard on the proving your work part because I wanted it to be crystal clear that this isn&amp;rsquo;t a pretty veneer over what is essentially a weather app — the Groundwise engine is doing sophisticated modeling in service of a &amp;ldquo;simple&amp;rdquo; yet nuanced and challenging question about rideability/playability/vulnerability (plant vulnerability in Yardwise).&lt;/p&gt;
&lt;p&gt;This is the opposite of how most weather apps work. They give you all the data and expect you to synthesize it into a decision. The Groundwise engine synthesizes first, then offers the data for verification. The user&amp;rsquo;s default is to trust the verdict and act on it. The detail is available but not required.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s what made three states better than a percentage. A percentage demands interpretation. A verdict offers a recommendation. The supporting detail is opt-in, not mandatory.&lt;/p&gt;
&lt;h2 id="thanks-for-reading"&gt;Thanks for Reading&lt;/h2&gt;
&lt;p&gt;This series covered a lot of ground, from the &lt;a href="https://stalefishlabs.com/read/2026-03-12-weather-engine-intro/"
&gt;core concept&lt;/a&gt; through the &lt;a href="https://stalefishlabs.com/read/2026-03-17-drying-model/"
&gt;drying math&lt;/a&gt;, &lt;a href="https://stalefishlabs.com/read/2026-03-20-one-engine-three-apps/"
&gt;multi-app architecture&lt;/a&gt;, &lt;a href="https://stalefishlabs.com/read/2026-03-23-edge-cases/"
&gt;winter edge cases&lt;/a&gt;, &lt;a href="https://stalefishlabs.com/read/2026-03-25-flipping-the-question/"
&gt;the Yardwise inversion&lt;/a&gt;, and now the verdict UX. If you&amp;rsquo;ve built something that turns noisy data into human decisions, I&amp;rsquo;d love to hear about your approach. The threshold and confidence problems are universal.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;The Groundwise engine powers &lt;a href="https://stalefishlabs.com/use/ridewise/"
target="_blank"
&gt;Ridewise&lt;/a&gt;, &lt;a href="https://stalefishlabs.com/use/fieldwise/"
target="_blank"
&gt;Fieldwise&lt;/a&gt;, and &lt;a href="https://stalefishlabs.com/use/yardwise/"
target="_blank"
&gt;Yardwise&lt;/a&gt; — all available for iOS from &lt;a href="https://stalefishlabs.com"
target="_blank"
&gt;Stalefish Labs&lt;/a&gt;. Find us on &lt;a href="https://bsky.app/profile/stalefishlabs.bsky.social"
target="_blank"
&gt;Bluesky&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;</content:encoded><dc:creator>Michael Morrison</dc:creator><enclosure url="https://stalefishlabs.com/percentagenomaybeyes.png" type="image/png" length="0"/></item><item><title>Flipping the Question: From 'Is It Too Wet?' to 'Is It Too Dry?'</title><link>https://stalefishlabs.com/read/2026-03-25-flipping-the-question/</link><pubDate>Wed, 25 Mar 2026 00:00:00 -0700</pubDate><guid>https://stalefishlabs.com/read/2026-03-25-flipping-the-question/</guid><description>The same engine that tells riders to stay home tells gardeners to grab the hose. Watering is its own problem.</description><content:encoded>&lt;p&gt;When I first built the Groundwise engine for the &lt;a href="https://stalefishlabs.com/use/ridewise/"
&gt;Ridewise app&lt;/a&gt;, it answered one question: &lt;strong&gt;is it too wet to ride?&lt;/strong&gt; Low wetness meant good conditions. High wetness meant stay home. Exactly what I needed for mountain biking, skateboarding, and other outdoor wheeled activities where surface conditions impacted by weather mattered.&lt;/p&gt;
&lt;p&gt;Then I started thinking about my garden.&lt;/p&gt;
&lt;p&gt;I have raised beds, a few containers on the patio, and a lawn that I&amp;rsquo;d like to keep alive without drowning it. I don&amp;rsquo;t get obsessive about it, and to be honest my lawn is far from impressive. I&amp;rsquo;m not one of those people who try to maintain golf course grass, far from it. But I&amp;rsquo;ve still regularly done that assessment where I look at the sky, vaguely remember whether it rained, and make the same kind of gut call on watering that I used to make about trails. The variables were familiar: recent rain, temperature, sun exposure, how fast things dry. I was running the same mental model, just asking the opposite question.&lt;/p&gt;
&lt;p&gt;That realization is what turned one app into three. If the engine could quantify moisture on a surface, it could answer both &amp;ldquo;is it too wet to ride?&amp;rdquo; and &amp;ldquo;is it too dry, should I water?&amp;rdquo;&lt;/p&gt;
&lt;h2 id="the-inversion"&gt;The Inversion&lt;/h2&gt;
&lt;p&gt;The engine always calculates a wetness score from 0 (bone dry) to 1 (saturated). The &lt;code&gt;EngineMode&lt;/code&gt; enum controls what that score means:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Wetness concern&lt;/strong&gt; (Ridewise, Fieldwise): Low wetness = Yes (go ride or play). High wetness = No (too wet).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Dryness concern&lt;/strong&gt; (Yardwise): Low wetness = Yes (water today). High wetness = No (skip watering).&lt;/p&gt;
&lt;p&gt;The verdict is the same enum, &lt;code&gt;Yes&lt;/code&gt;, &lt;code&gt;Maybe&lt;/code&gt;, &lt;code&gt;No&lt;/code&gt;, but the interpretation flips. This means the consuming app doesn&amp;rsquo;t need to know which mode produced the result. It renders green for Yes, orange for Maybe, red for No, regardless.&lt;/p&gt;
&lt;p&gt;The thresholds shift too:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Yes&lt;/th&gt;
&lt;th&gt;Maybe&lt;/th&gt;
&lt;th&gt;No&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Wetness concern&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&amp;lt; 0.30&lt;/td&gt;
&lt;td&gt;0.30 – 0.60&lt;/td&gt;
&lt;td&gt;≥ 0.60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Dryness concern&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&amp;lt; 0.15&lt;/td&gt;
&lt;td&gt;0.15 – 0.45&lt;/td&gt;
&lt;td&gt;≥ 0.45&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Yardwise thresholds are lower because the stakes are asymmetric. This wasn&amp;rsquo;t immediately obvious until testing early versions of the app, when I realized that missing a watering day rarely if ever harms established plants. Riding a muddy trail damages the surface. So Yardwise is more lenient than the other apps, and leans toward &amp;ldquo;maybe check the soil&amp;rdquo; rather than &amp;ldquo;definitely water&amp;rdquo; — this makes the verdict less alarming. The reality is that the cost of a false positive (unnecessary watering) is real (overwatering causes its own problems), while the cost of a false negative (skipping one day) is usually trivial.&lt;/p&gt;
&lt;h2 id="manual-watering-tracking-what-the-weather-doesnt-know"&gt;Manual Watering: Tracking What the Weather Doesn&amp;rsquo;t Know&lt;/h2&gt;
&lt;p&gt;Here&amp;rsquo;s where Yardwise diverges from Ridewise and Fieldwise most sharply. The weather API knows about rain. It doesn&amp;rsquo;t know that you ran the sprinkler for 20 minutes yesterday evening.&lt;/p&gt;
&lt;p&gt;Yardwise lets users log manual watering events with timestamps. The engine converts these into precipitation equivalents that then get added to the rain score alongside actual precipitation, with the same time-weighted decay:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;0-24 hours ago: 0.7x weight (70% contribution)
24-48 hours ago: 0.2x weight
48-72 hours ago: 0.1x weight
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;A watering yesterday contributes about 0.175 inches to the effective precipitation (0.25 × 0.7). That&amp;rsquo;s enough to shift a borderline &amp;ldquo;water today&amp;rdquo; verdict to &amp;ldquo;check soil&amp;rdquo; or even &amp;ldquo;skip.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;The decay is important. A watering three days ago shouldn&amp;rsquo;t prevent the engine from recommending water today, the moisture is long gone, especially in containers with fast-draining potting mix. The time-weighted model handles this naturally.&lt;/p&gt;
&lt;h3 id="cold-weather-extends-watering-memory"&gt;Cold Weather Extends Watering Memory&lt;/h3&gt;
&lt;p&gt;One wrinkle: cold weather slows evapotranspiration. A watering event that would normally decay in 48 hours can remain relevant for up to 96 hours during cold weather. The engine extends the effective window based on the same cold factor used for dormancy:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;wateringWindow = 48 + 48 × coldFactor
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;At 34°F, the cold factor is about 0.62, giving a window of roughly 78 hours. At 45°F, it&amp;rsquo;s about 56 hours. This prevents the engine from recommending watering when yesterday&amp;rsquo;s water is still sitting in cold, slowly-evaporating soil. Keep in mind that winter watering is pretty rare, reserved almost exclusively for new plantings (trees, shrubs, etc.) and only during an unusual dry spell.&lt;/p&gt;
&lt;h2 id="establishment-sensitivity-protecting-young-plants"&gt;Establishment Sensitivity: Protecting Young Plants&lt;/h2&gt;
&lt;p&gt;Newly seeded lawns and recently transplanted plants need more water than established ones, and they&amp;rsquo;re far more susceptible to drought. The engine handles this through an establishment sensitivity boost that layers on top of the surface type&amp;rsquo;s base damage sensitivity.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Establishment&lt;/th&gt;
&lt;th&gt;Sensitivity Boost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Established&lt;/td&gt;
&lt;td&gt;+0.0 (default)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Newly planted&lt;/td&gt;
&lt;td&gt;+0.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Newly seeded&lt;/td&gt;
&lt;td&gt;+0.5&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This boost affects the sensitivity veto, the mechanism that pushes borderline verdicts toward protection. With a newly seeded lawn (base sensitivity 0.4 + boost 0.5 = 0.9 effective sensitivity), a Maybe verdict with wetness below 0.3 gets overridden to Yes: water those seeds.&lt;/p&gt;
&lt;p&gt;For established plants with no boost, the same borderline conditions stay as Maybe: check the soil yourself. The engine doesn&amp;rsquo;t push you to water unless there&amp;rsquo;s a fragile surface that genuinely needs protection.&lt;/p&gt;
&lt;p&gt;This is the same sensitivity veto that Fieldwise uses to protect natural grass athletic fields from being played on when borderline wet. Same mechanism, opposite direction. In wetness-concern mode, high sensitivity + borderline conditions → No (protect from use). In dryness-concern mode, high sensitivity + borderline conditions → Yes (protect from drought).&lt;/p&gt;
&lt;h2 id="dormancy-and-evaporative-demand"&gt;Dormancy and Evaporative Demand&lt;/h2&gt;
&lt;p&gt;Two Yardwise-specific wetness modifiers that were covered in the &lt;a href="https://stalefishlabs.com/read/2026-03-23-edge-cases/"
&gt;edge cases article&lt;/a&gt; deserve a brief recap in the context of the inversion:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cold-weather dormancy&lt;/strong&gt; injects additional wetness into the score when temperatures drop below 55°F. This suppresses watering recommendations by pushing the score toward the &amp;ldquo;skip&amp;rdquo; zone because dormant plants don&amp;rsquo;t benefit from watering and the moisture promotes root rot and fungal growth.&lt;/p&gt;
&lt;p&gt;From the engine&amp;rsquo;s perspective, dormancy is saying: &amp;ldquo;the soil might technically be dry, but the plant doesn&amp;rsquo;t need water right now, so act as if conditions are wetter than they are.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Low evaporative demand&lt;/strong&gt; does something similar on cool, overcast, humid days. Even if the soil surface looks dry, the plant isn&amp;rsquo;t losing much water through transpiration when there&amp;rsquo;s no sun and the air is already saturated. A small wetness boost (up to 0.25) prevents unnecessary watering recommendations.&lt;/p&gt;
&lt;p&gt;Both modifiers only activate in dryness-concern mode. They don&amp;rsquo;t make sense for riders or field sports, cold weather doesn&amp;rsquo;t make a trail less muddy, and overcast skies don&amp;rsquo;t affect whether the ground is rideable or a football field is playable.&lt;/p&gt;
&lt;h2 id="yardwise-surface-types"&gt;Yardwise Surface Types&lt;/h2&gt;
&lt;p&gt;The Groundwise family shares a surface type system, but Yardwise introduces types that don&amp;rsquo;t exist in the riding or sports world:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Potting mix&lt;/strong&gt; (containers) dries at 2.0x — the same rate as concrete. This isn&amp;rsquo;t a coincidence. Potting mix is engineered for drainage, just like concrete. Containers are also typically exposed to wind on all sides, which accelerates drying considerably. The result: containers often need daily watering in summer, even after rain. The engine captures this naturally because the high drying multiplier clears moisture quickly.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Amended soil with mulch&lt;/strong&gt; dries at 0.7x — the slowest rate in the system, tied with clay. Mulch deliberately slows evaporation. A mulched garden bed after rain stays moist for days. The engine&amp;rsquo;s residual wetness model (which only activates for absorbent surfaces above 0.25 inches of rain) extends this further, keeping the score in &amp;ldquo;skip watering&amp;rdquo; territory well after a good rain.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Fresh seed&lt;/strong&gt; has the highest effective damage sensitivity in the system: base 0.8 plus an establishment boost of 0.5, capped at 1.0. The engine is maximally protective of newly seeded areas, pushing any borderline verdict toward &amp;ldquo;water.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Compost&lt;/strong&gt; is the most forgiving surface: 1.2x drying multiplier and only 0.3 damage sensitivity. Compost generates internal heat from decomposition, which drives some of its own drying. And it&amp;rsquo;s hard to damage, overwatering a compost pile isn&amp;rsquo;t really a concern. The engine mostly stays out of the way for compost, skewing toward &amp;ldquo;skip&amp;rdquo; unless conditions are genuinely dry.&lt;/p&gt;
&lt;h2 id="the-insight-that-made-it-work"&gt;The Insight That Made It Work&lt;/h2&gt;
&lt;p&gt;The hardest part of building Yardwise wasn&amp;rsquo;t the code, it was convincing myself that the inversion was valid. Every instinct I&amp;rsquo;d built while developing Ridewise and Fieldwise said &amp;ldquo;wet = bad.&amp;rdquo; Retraining my thinking to &amp;ldquo;wet = good (for gardening)&amp;rdquo; took effort.&lt;/p&gt;
&lt;p&gt;What made it click was realizing that the engine isn&amp;rsquo;t really about wet or dry. It&amp;rsquo;s about &lt;strong&gt;moisture state relative to the ideal for a given surface and activity.&lt;/strong&gt; For a trail, the ideal is dry. For a garden bed, the ideal is moist (not soaked!). The engine measures distance from ideal in both directions.&lt;/p&gt;
&lt;p&gt;Once I saw it that way, the inversion was mechanical. Same measurements, same model, same pipeline. Just a different definition of &amp;ldquo;good.&amp;rdquo;&lt;/p&gt;
&lt;h2 id="next-in-the-series"&gt;Next in the Series&lt;/h2&gt;
&lt;p&gt;The &lt;a href="https://stalefishlabs.com/read/2026-03-27-uncertain-verdicts/"
&gt;final article&lt;/a&gt; covers the verdict UX, why three states beat a percentage, how the engine communicates uncertainty through confidence levels and contributing factors, and the role of the recovery outlook in managing expectations.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://stalefishlabs.com/use/yardwise/"
target="_blank"
&gt;Yardwise&lt;/a&gt; is available for iOS from &lt;a href="https://stalefishlabs.com"
target="_blank"
&gt;Stalefish Labs&lt;/a&gt;. Same engine as &lt;a href="https://stalefishlabs.com/use/ridewise/"
target="_blank"
&gt;Ridewise&lt;/a&gt; and &lt;a href="https://stalefishlabs.com/use/fieldwise/"
target="_blank"
&gt;Fieldwise&lt;/a&gt;, different question.&lt;/em&gt;&lt;/p&gt;</content:encoded><dc:creator>Michael Morrison</dc:creator><enclosure url="https://stalefishlabs.com/wetdryyard.png" type="image/png" length="0"/></item><item><title>Edge Cases That Break Your Weather Model</title><link>https://stalefishlabs.com/read/2026-03-23-edge-cases/</link><pubDate>Mon, 23 Mar 2026 00:00:00 -0700</pubDate><guid>https://stalefishlabs.com/read/2026-03-23-edge-cases/</guid><description>Freeze-thaw, snow melt, rain intensity, plant dormancy — the real-world complexity simple weather models miss.</description><content:encoded>&lt;p&gt;This is a continuation of a deep-dive into the weather engine that drives our Groundwise apps. Last we looked into the core &lt;a href="https://stalefishlabs.com/read/2026-03-17-drying-model/"
&gt;drying model&lt;/a&gt;, which handles most days well. Sun, wind, time, surface type — combine them sensibly and you get a reasonable verdict most of the time.&lt;/p&gt;
&lt;p&gt;Then winter arrives and everything breaks. Interestingly, the engine was developed during the epic ice storm of 2026 that absolutely decimated parts of the southeastern U.S., including Nashville, TN where we&amp;rsquo;re based. So I got to experience first-hand a very real edge case as I was building the engine, and literally each day presented new challenges to clarify for example how long it actually takes a trail to recover from a prolonged frozen period.&lt;/p&gt;
&lt;p&gt;This article covers the edge cases that forced the most complex logic in the Groundwise engine, the scenarios where the simple model produces confidently wrong answers.&lt;/p&gt;
&lt;h2 id="freezethaw-360-lines-of-humility"&gt;Freeze/Thaw: 360 Lines of Humility&lt;/h2&gt;
&lt;p&gt;The frozen conditions check is the single largest block of code in the engine. It runs first, before any moisture modeling, because frozen ground is a fundamentally different hazard than wet ground.&lt;/p&gt;
&lt;p&gt;The naive approach would be simple: if the temperature is below 32°F, say No. But that misses almost everything that matters.&lt;/p&gt;
&lt;h3 id="hard-surfaces-vs-ground-different-failure-modes"&gt;Hard Surfaces vs. Ground: Different Failure Modes&lt;/h3&gt;
&lt;p&gt;A frozen concrete skatepark and a frozen dirt trail are dangerous for completely different reasons, and they recover at completely different speeds.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Concrete and asphalt&lt;/strong&gt; develop ice when moisture freezes on the surface. It&amp;rsquo;s a thin layer — dangerous because it&amp;rsquo;s invisible, but it clears relatively quickly once temperatures rise. At 55°F, a frozen skatepark is typically safe within 6 hours. At 50°F, give it 12. At 45°F, 24 hours, or just wait until 3 days after the last rain when there&amp;rsquo;s simply no moisture left to freeze.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Dirt and natural grass&lt;/strong&gt; hold moisture internally. When they freeze, the ice is &lt;em&gt;in&lt;/em&gt; the ground, not just on top of it. Thawing releases that moisture all at once, creating a slurry that&amp;rsquo;s worse than the original wet conditions. A ground trail at 45°F needs 72 hours to fully recover from a freeze — not because ice persists that long, but because the thaw creates its own wetness event. It&amp;rsquo;s worth noting that one thing the engine does not attempt to factor in is the counterintuitive scenario where frozen mountain bike trails are sometimes &lt;em&gt;more&lt;/em&gt; rideable when fully frozen due to the combo of frost heave breaking up the surface tread and then a deep freeze solidifying that oatmeal-like top layer into a grippy crunch. If you bundle up, some of the best winter riding here is when a trail fully heaves and freezes, but that seemed like a special enough case to not factor in (at least not yet!), especially when you factor in ride comfort.&lt;/p&gt;
&lt;p&gt;The engine models the concrete/asphalt vs. dirt/grass freeze issue with separate escape conditions for draining vs. absorbent surfaces:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Temperature&lt;/th&gt;
&lt;th&gt;Hard Surface Recovery&lt;/th&gt;
&lt;th&gt;Ground Recovery&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;≥ 55°F&lt;/td&gt;
&lt;td&gt;6 hours&lt;/td&gt;
&lt;td&gt;24 hours&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;≥ 50°F&lt;/td&gt;
&lt;td&gt;12 hours&lt;/td&gt;
&lt;td&gt;48 hours&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;≥ 45°F&lt;/td&gt;
&lt;td&gt;24 hours (or 3+ days since rain)&lt;/td&gt;
&lt;td&gt;72 hours&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt; 45°F&lt;/td&gt;
&lt;td&gt;Still frozen&lt;/td&gt;
&lt;td&gt;Still frozen&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="the-near-freezing-zone"&gt;The Near-Freezing Zone&lt;/h3&gt;
&lt;p&gt;32°F isn&amp;rsquo;t a magic line. Ice can persist on surfaces at 34°F, especially in shade. And moisture can pose a freeze risk at 38°F if temperatures are dropping. Throw in wind and it&amp;rsquo;s pretty evident that a simple 32°F freeze check isn&amp;rsquo;t sufficient.&lt;/p&gt;
&lt;p&gt;The engine treats 32-38°F as a caution zone. If there&amp;rsquo;s been recent precipitation (last 24 hours) and the temperature is in this range, the verdict is No with medium confidence. Not because ice is definitely present, but because the risk isn&amp;rsquo;t worth it.&lt;/p&gt;
&lt;h3 id="overnight-freeze-currently-above-freezing"&gt;Overnight Freeze, Currently Above Freezing&lt;/h3&gt;
&lt;p&gt;This is the most common winter scenario and the hardest to get right, especially in a moderate climate like the southeast where it can freeze overnight and then rise to sunny and 50s during the day. So an overnight freeze that changes to 52°F mid-day&amp;hellip;is the trail rideable?&lt;/p&gt;
&lt;p&gt;It depends on:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;How long it&amp;rsquo;s been above freezing&lt;/strong&gt; — just crossed 32°F an hour ago? Still frozen. Been above freezing since 9am and it&amp;rsquo;s now 2pm? Probably thawed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What surface you&amp;rsquo;re on&lt;/strong&gt; — concrete sheds faster than dirt.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Whether there&amp;rsquo;s recent precipitation&lt;/strong&gt; — dry freeze is different from wet freeze.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Humidity&lt;/strong&gt; — above 70% humidity with a recent overnight freeze means possible frost even on surfaces that look dry.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The engine tracks &lt;code&gt;hoursBelowFreezing&lt;/code&gt; and &lt;code&gt;hoursSinceThawBegan&lt;/code&gt; to model this progression. A surface that was frozen for 48 hours takes longer to fully thaw than one that dipped below freezing for 4 hours overnight.&lt;/p&gt;
&lt;h3 id="extended-freeze-with-no-recent-rain"&gt;Extended Freeze With No Recent Rain&lt;/h3&gt;
&lt;p&gt;It gets even trickier when you remove precipitation for a while. Here&amp;rsquo;s a counterintuitive case: it&amp;rsquo;s been below freezing for three days, but it hasn&amp;rsquo;t rained or snowed in a week. Is it safe?&lt;/p&gt;
&lt;p&gt;For &lt;strong&gt;hard surfaces&lt;/strong&gt;: probably yes. No moisture means nothing to freeze. The engine still checks humidity (frost can form from humid air alone), but without recent precipitation, hard surfaces are likely clear.&lt;/p&gt;
&lt;p&gt;For &lt;strong&gt;ground surfaces&lt;/strong&gt;: still no. Even without recent rain, ground retains moisture from weeks of accumulated precipitation. A multi-day freeze locks that moisture in. When thaw comes, it releases.&lt;/p&gt;
&lt;h2 id="snow-melt-a-bell-curve-not-a-line"&gt;Snow Melt: A Bell Curve, Not a Line&lt;/h2&gt;
&lt;p&gt;Snow melt seems simple — snow melts, things get wet, then they dry. But the wetness injection from melting snow follows a curve that&amp;rsquo;s nothing like the linear decay used for rain timing.&lt;/p&gt;
&lt;p&gt;The engine models thaw wetness on a bell curve based on melt progress:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Melt Progress&lt;/th&gt;
&lt;th&gt;Wetness Factor&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt; 5%&lt;/td&gt;
&lt;td&gt;0.7 → 1.0&lt;/td&gt;
&lt;td&gt;Starting to melt, moisture building&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5-40%&lt;/td&gt;
&lt;td&gt;1.0&lt;/td&gt;
&lt;td&gt;Peak wetness, active melt, ground saturated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;40-70%&lt;/td&gt;
&lt;td&gt;1.0 → 0.4&lt;/td&gt;
&lt;td&gt;Most snow gone, drainage beginning&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;70%+&lt;/td&gt;
&lt;td&gt;0.4 → 0.2&lt;/td&gt;
&lt;td&gt;Residual moisture, mostly clear&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Melt progress is estimated from hours since thaw began, with the assumption that most accumulations take about 48 hours to fully melt. Temperature above freezing drives the rate, warmer means faster.&lt;/p&gt;
&lt;p&gt;The peak wetness window (5-40% melted) is deliberately wide. During active melt, the ground is receiving a continuous supply of water. Unlike rain, which dumps water and stops, snow melt is a slow, sustained event that can keep surfaces saturated for hours.&lt;/p&gt;
&lt;p&gt;Snow accumulation matters too. Did you know that on average, 10 inches of snow is equivalent to 1 inch of liquid rain (a 10:1 ratio). However, this ratio varies significantly based on temperature, ranging from 5 inches (wet snow) to over 20 inches (dry, powdery snow) of snow for every 1 inch of liquid. But what we really care about is how much snow results in complete saturation. Here&amp;rsquo;s how the engine scales the initial wetness injection for snow:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;snowFactor = clamp(0.5 + snowAccumulation / 4.0, 0, 1)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Half an inch gives a snowFactor of 0.625. Four inches saturates at 1.0. This prevents a light dusting from being treated the same as a significant snowfall.&lt;/p&gt;
&lt;h3 id="when-theres-no-tracked-snow"&gt;When There&amp;rsquo;s No Tracked Snow&lt;/h3&gt;
&lt;p&gt;Sometimes the engine knows there was a freeze/thaw cycle but doesn&amp;rsquo;t have explicit snow accumulation data. In that case, it falls back to estimating initial moisture from freeze severity:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;initialMoisture = 0.3 + 0.3 × freezeSeverity
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Where freeze severity scales from 0.3 (24 hours below freezing) to 0.6 (4+ days below freezing). Longer freezes lock more ground moisture, producing more wetness when thaw arrives.&lt;/p&gt;
&lt;p&gt;The decay uses a half-life model, a baseline of 48 hours, stretched dramatically when overnight temperatures keep dropping below freezing. A thaw that refreezes each night can keep surfaces problematic for over a week, because each night arrests the drying process and each morning restarts the moisture release.&lt;/p&gt;
&lt;h2 id="precipitation-intensity-same-amount-different-impact"&gt;Precipitation Intensity: Same Amount, Different Impact&lt;/h2&gt;
&lt;p&gt;The &lt;a href="https://stalefishlabs.com/read/2026-03-17-drying-model/"
&gt;drying model article&lt;/a&gt; covered the rain pattern multiplier (0.7x for light, 1.1x for steady, 1.5x for downpour), but intensity creates edge cases beyond just the multiplier.&lt;/p&gt;
&lt;p&gt;A quarter inch of light rain over four hours &lt;strong&gt;soaks into absorbent surfaces gradually&lt;/strong&gt;. The ground absorbs it progressively, and drainage keeps up. Surface water is minimal. This is the kind of rain you hear gardeners, landscapers, and farmers wishing for as it&amp;rsquo;s the best watering rain for plants, slow and steady.&lt;/p&gt;
&lt;p&gt;A quarter inch dumped in 20 minutes, on the other hand, &lt;strong&gt;overwhelms drainage&lt;/strong&gt;. Water pools on the surface, runs off trails causing erosion, and saturates the top layer before it can percolate down. The surface is wetter even though the total precipitation is identical.&lt;/p&gt;
&lt;p&gt;The 1.5x downpour multiplier captures this, but it&amp;rsquo;s an approximation. In reality, the impact depends heavily on the surface&amp;rsquo;s infiltration rate, slope, and drainage design — none of which the engine models directly. And it doesn&amp;rsquo;t try.&lt;/p&gt;
&lt;p&gt;This is one of the spots where the engine&amp;rsquo;s approximation is &amp;ldquo;good enough for most cases&amp;rdquo; rather than trying to be physically accurate to the extreme. A purpose-built trail with water bars and crowned surfaces handles a downpour better than a flat trail in a natural depression. The engine treats both as dirt with a 1.0x drying multiplier, which is imprecise but still more useful than ignoring intensity entirely. This is also worth flagging where often a Maybe verdict is truly the best answer because it tells you conditions are borderline, and your own local knowledge may tip the final ride decision. Yes, the app is attempting to assist in the human intuition of weather conditions, but not replace it entirely.&lt;/p&gt;
&lt;h2 id="cold-weather-dormancy-protecting-plants-from-themselves"&gt;Cold-Weather Dormancy: Protecting Plants From Themselves&lt;/h2&gt;
&lt;p&gt;This edge case is Yardwise-specific, but it&amp;rsquo;s one of my favorites because it&amp;rsquo;s a case where the &amp;ldquo;right&amp;rdquo; answer is counterintuitive.&lt;/p&gt;
&lt;p&gt;When temperatures drop below 55°F, most plants enter dormancy. Their water uptake drops dramatically. Watering dormant plants typically doesn&amp;rsquo;t help them, it can all too easily create conditions for root rot and fungal disease. In this scenario the engine needs to &lt;strong&gt;suppress watering recommendations&lt;/strong&gt; even when the soil looks dry.&lt;/p&gt;
&lt;p&gt;The dormancy calculation uses a non-linear curve:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;coldFactor = pow((55 - temperature) / 23, 0.6)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Why &lt;code&gt;pow(x, 0.6)&lt;/code&gt; instead of linear? Because the suppression should be strong even at moderate cold. At 45°F (10 degrees below the 55°F threshold), a linear model gives a cold factor of 0.43. The power curve gives 0.56, which is meaningfully stronger. The difference matters because 45°F is genuinely cold enough to suppress plant activity, and the engine should reflect that.&lt;/p&gt;
&lt;p&gt;The dormancy score gets amplified by:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Freeze history&lt;/strong&gt; — if it&amp;rsquo;s been below 32°F for 24+ hours recently, plants are deeply dormant. Add 0.25 × coldFactor.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Recent cold-weather watering&lt;/strong&gt; — if the user watered during cold weather, that water persists much longer because evapotranspiration is minimal. The residual window extends from 48 hours to up to 96 hours. And yes, evapotranspiration is a real word&amp;hellip;I couldn&amp;rsquo;t resist using it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But there&amp;rsquo;s a warm-day dampener too. If the daytime high reaches 65°F even though it&amp;rsquo;s cold right now, the suppression eases. This handles the classic spring pattern: cold mornings, warm afternoons. Plants &lt;em&gt;are&lt;/em&gt; still somewhat active on those warm afternoon hours, and a warm day drives real evaporation.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;warmDampening = clamp((warmerTemp - 65) / 30, 0, 0.5)
dormancyMoisture *= (1.0 - warmDampening)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;At 80°F daytime highs, the dampening cuts dormancy suppression in half. At 95°F, it&amp;rsquo;s fully halved. The cold mornings still matter, but the warm afternoons are doing real drying work.&lt;/p&gt;
&lt;h2 id="low-evaporative-demand-when-dry-isnt-thirsty"&gt;Low Evaporative Demand: When Dry Isn&amp;rsquo;t Thirsty&lt;/h2&gt;
&lt;p&gt;Another Yardwise-specific edge case: on overcast, humid days with moderate temperatures, the soil might technically be &amp;ldquo;dry&amp;rdquo; by the engine&amp;rsquo;s moisture model, but the plants aren&amp;rsquo;t actually losing much water because evaporative demand is low.&lt;/p&gt;
&lt;p&gt;Cloudy skies reduce solar radiation. High humidity reduces the vapor pressure gradient that drives transpiration. If both conditions are present and the temperature is under 85°F, the engine injects a small wetness boost (up to 0.25) to push borderline &amp;ldquo;water today&amp;rdquo; verdicts toward &amp;ldquo;check soil&amp;rdquo; or &amp;ldquo;skip.&amp;rdquo;&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;cloudFactor = clamp((cloudCover - 0.3) / 0.7, 0, 1)
humidityFactor = clamp((humidity - 0.4) / 0.5, 0, 1)
demandReduction = cloudFactor × 0.55 + humidityFactor × 0.45
boost = demandReduction × 0.25
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The guard at 85°F is important. Hot weather drives real water demand regardless of clouds or humidity. Above that threshold, evaporative demand is high enough that the boost doesn&amp;rsquo;t apply.&lt;/p&gt;
&lt;p&gt;This is a small adjustment, 0.25 at maximum, but it prevents the engine from recommending watering on days when the lawn genuinely doesn&amp;rsquo;t need it. Overwatering is a real problem, especially for casual gardeners who might not realize that a cool, overcast day means their yard is fine.&lt;/p&gt;
&lt;h2 id="the-meta-lesson"&gt;The Meta-Lesson&lt;/h2&gt;
&lt;p&gt;Every one of these edge cases started as a wrong verdict. A friend texted me &amp;ldquo;your app said Yes but the trail was iced over.&amp;rdquo; A beta tester reported &amp;ldquo;it&amp;rsquo;s telling me to water but it&amp;rsquo;s 40 degrees.&amp;rdquo; More personally, I&amp;rsquo;m literally looking at my skateboard ramp covered in ice and the app telling me it&amp;rsquo;s shred-ready. Nope.&lt;/p&gt;
&lt;p&gt;The temptation each time was to add a quick patch, an &lt;code&gt;if&lt;/code&gt; statement for the specific scenario. What I tried to do instead was understand &lt;em&gt;why&lt;/em&gt; the model was wrong and fix the underlying assumption. Usually the answer was: the model was treating something as a smooth continuum when reality has phase transitions and state changes.&lt;/p&gt;
&lt;p&gt;Water doesn&amp;rsquo;t gradually become less liquid as it gets colder. It freezes. Plants don&amp;rsquo;t linearly reduce water uptake as temperature drops. They go dormant. Snow doesn&amp;rsquo;t dry like rain. It melts.&lt;/p&gt;
&lt;p&gt;The edge cases are where the domain expertise lives. The drying model is arithmetic. The freeze/thaw logic is hard-won knowledge about how the physical world actually works.&lt;/p&gt;
&lt;h2 id="next-in-the-series"&gt;Next in the Series&lt;/h2&gt;
&lt;p&gt;The &lt;a href="https://stalefishlabs.com/read/2026-03-25-flipping-the-question/"
&gt;next article&lt;/a&gt; covers the Yardwise inversion, how the engine flips from &amp;ldquo;is it too wet?&amp;rdquo; to &amp;ldquo;is it too dry?&amp;rdquo; and the additional features (manual watering tracking, establishment sensitivity) that make gardening a distinct problem from riding and field sports.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;The Groundwise engine powers &lt;a href="https://stalefishlabs.com/use/ridewise/"
target="_blank"
&gt;Ridewise&lt;/a&gt;, &lt;a href="https://stalefishlabs.com/use/fieldwise/"
target="_blank"
&gt;Fieldwise&lt;/a&gt;, and &lt;a href="https://stalefishlabs.com/use/yardwise/"
target="_blank"
&gt;Yardwise&lt;/a&gt; — all available for iOS from &lt;a href="https://stalefishlabs.com"
target="_blank"
&gt;Stalefish Labs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;</content:encoded><dc:creator>Michael Morrison</dc:creator><enclosure url="https://stalefishlabs.com/mtbfrozenedge.png" type="image/png" length="0"/></item><item><title>One Engine, Three Apps: Sharing a Swift Decision Engine Across Products</title><link>https://stalefishlabs.com/read/2026-03-20-one-engine-three-apps/</link><pubDate>Fri, 20 Mar 2026 00:00:00 -0700</pubDate><guid>https://stalefishlabs.com/read/2026-03-20-one-engine-three-apps/</guid><description>Structuring a shared Swift package across three apps with different surfaces, thresholds, and verdicts.</description><content:encoded>&lt;p&gt;In the &lt;a href="https://stalefishlabs.com/read/2026-03-12-weather-engine-intro/"
&gt;previous articles&lt;/a&gt; I&amp;rsquo;ve covered what the Groundwise engine does and &lt;a href="https://stalefishlabs.com/read/2026-03-17-drying-model/"
&gt;how the drying model works&lt;/a&gt;. This article is about the architectural decision that turned one app into three: sharing a single decision engine across Ridewise (trail conditions), Fieldwise (sports field conditions), and Yardwise (watering guidance).&lt;/p&gt;
&lt;p&gt;The pitch sounds clean: &amp;ldquo;one engine, three apps.&amp;rdquo; The reality required some specific design choices to keep it from becoming a tangled mess of conditionals.&lt;/p&gt;
&lt;h2 id="the-shape-of-the-problem"&gt;The Shape of the Problem&lt;/h2&gt;
&lt;p&gt;The initial problem was how to apply human intuition to map recent/current weather conditions onto different kinds of surfaces to assess &amp;ldquo;rideability,&amp;rdquo; the application being that I wanted a simple verdict on if a mountain bike trail or skateboard ramp was sufficiently dry to session. That&amp;rsquo;s it, weather inputs in and surface type in, rideability verdict out. And it worked, the app Ridewise solves the problem, and in building it I created a slick little software engine. The thing is, once you&amp;rsquo;ve built an engine, you start to think about other things it might solve. In this case I realized the Groundwise engine is really answering a question more general than mountain biking or skateboarding, it&amp;rsquo;s answering the fundamental question: &lt;strong&gt;what&amp;rsquo;s the moisture situation at this spot?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So the idea of three different apps started to coalesce, and their distinguishing characteristics began to emerge:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cares about different &lt;strong&gt;surfaces&lt;/strong&gt; (skateparks vs. soccer fields vs. herb gardens)&lt;/li&gt;
&lt;li&gt;Has different &lt;strong&gt;thresholds&lt;/strong&gt; for what counts as &amp;ldquo;too wet&amp;rdquo; or &amp;ldquo;too dry&amp;rdquo;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Interprets the engine verdict differently&lt;/strong&gt; (wet is bad for riders, good for gardeners)&lt;/li&gt;
&lt;li&gt;Needs &lt;strong&gt;app-specific logic&lt;/strong&gt; (gardeners track manual watering, riders don&amp;rsquo;t)&lt;/li&gt;
&lt;li&gt;Uses &lt;strong&gt;different language&lt;/strong&gt; in the rationale (&amp;ldquo;trail might be muddy&amp;rdquo; vs. &amp;ldquo;field may hold water&amp;rdquo; vs. &amp;ldquo;soil has enough moisture&amp;rdquo;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The question was whether to fork the engine into three copies, or keep one engine and parameterize the differences. I went with parameterization, and the key that made it work was keeping the customization surface small. As you&amp;rsquo;ll see, this was a key design decision early that paid off big later.&lt;/p&gt;
&lt;h2 id="enginemode-flipping-the-perspective"&gt;EngineMode: Flipping the Perspective&lt;/h2&gt;
&lt;p&gt;One of the most key types in the Groundwise engine is what allows it to pivot between caring about dryness or caring about wetness:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-swift" data-lang="swift"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;enum&lt;/span&gt; &lt;span class="nc"&gt;EngineMode&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;wetnessConcern&lt;/span&gt; &lt;span class="c1"&gt;// Ridewise, Fieldwise&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;drynessConcern&lt;/span&gt; &lt;span class="c1"&gt;// Yardwise&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The engine always calculates a wetness score from 0 (bone dry) to 1 (saturated). &lt;code&gt;EngineMode&lt;/code&gt; controls what that score &lt;em&gt;means&lt;/em&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Wetness concern:&lt;/strong&gt; Low score = Yes (go ride), high score = No (too wet)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dryness concern:&lt;/strong&gt; Low score = Yes (water your plants), high score = No (skip watering)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The verdict enum is the same in both modes (&lt;code&gt;Yes&lt;/code&gt;, &lt;code&gt;Maybe&lt;/code&gt;, &lt;code&gt;No&lt;/code&gt;) but the &lt;em&gt;interpretation&lt;/em&gt; inverts. This is a deliberate choice. The consuming app doesn&amp;rsquo;t need to know which mode produced the verdict. It just renders appropriate app-specific colors/symbols for Yes, Maybe, and No.&lt;/p&gt;
&lt;h2 id="sitetype-a-unified-wrapper"&gt;SiteType: A Unified Wrapper&lt;/h2&gt;
&lt;p&gt;Each app has its own domain vocabulary. Ridewise has &amp;ldquo;spots&amp;rdquo; (trails, skateparks), Fieldwise has &amp;ldquo;fields&amp;rdquo; (baseball diamonds, tennis courts), Yardwise has &amp;ldquo;areas&amp;rdquo; (lawns, raised beds). Rather than making the engine accept three different input types, they&amp;rsquo;re wrapped in a single enum:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-swift" data-lang="swift"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;enum&lt;/span&gt; &lt;span class="nc"&gt;SiteType&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;spot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SpotType&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// Ridewise: trail, skatepark, bikeJumps, pumpTrack...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;FieldType&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// Fieldwise: baseball, soccer, tennis, rugby...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;area&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AreaType&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// Yardwise: lawn, raisedBed, container, compost...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The key thing we&amp;rsquo;re trying to arrive at for wetness/dryness purposes is a surface type. Each case in this enum maps to a &lt;code&gt;SurfaceType&lt;/code&gt;, the thing the engine actually cares about. A &lt;code&gt;SpotType.skatepark&lt;/code&gt; maps to &lt;code&gt;SurfaceType.concrete&lt;/code&gt;. A &lt;code&gt;FieldType.baseball&lt;/code&gt; maps to &lt;code&gt;SurfaceType.naturalGrass&lt;/code&gt;. A &lt;code&gt;AreaType.container&lt;/code&gt; maps to &lt;code&gt;SurfaceType.pottingMix&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The engine never branches on &lt;code&gt;SpotType&lt;/code&gt; or &lt;code&gt;FieldType&lt;/code&gt; directly. It resolves the surface type up front, then works exclusively with surface properties. This is what keeps the core logic free of app-specific conditionals, and ultimately what enables engine reuse across apps with different concerns.&lt;/p&gt;
&lt;h2 id="surface-types-the-parameterization-layer"&gt;Surface Types: The Parameterization Layer&lt;/h2&gt;
&lt;p&gt;The apps currently have seventeen surface types to encode the physical properties that actually matter for moisture modeling:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-swift" data-lang="swift"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Each surface type defines:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;dryingMultiplier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Double&lt;/span&gt; &lt;span class="c1"&gt;// 0.7 (clay) to 2.8 (metal)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;damageSensitivity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Double&lt;/span&gt; &lt;span class="c1"&gt;// 0.0 to 1.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;isDrainingSurface&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Bool&lt;/span&gt; &lt;span class="c1"&gt;// sheds water vs. absorbs&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;isAbsorbentSurface&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Bool&lt;/span&gt; &lt;span class="c1"&gt;// holds water in material&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;safetySensitivity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Double&lt;/span&gt; &lt;span class="c1"&gt;// slip risk when wet&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;qualitySensitivity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Double&lt;/span&gt; &lt;span class="c1"&gt;// quality degradation when wet&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The engine uses these properties, never the surface type identity, to modulate its calculations. Drying multiplier scales how fast moisture clears. Damage sensitivity controls the sensitivity veto (should the engine push borderline verdicts toward protection?). Draining vs. absorbent determines whether residual wetness applies.&lt;/p&gt;
&lt;p&gt;This means adding a new surface type is a data change, not a logic change. If someone wanted to add &amp;ldquo;packed gravel&amp;rdquo; for Ridewise, they&amp;rsquo;d define its properties and it would flow through the existing pipeline.&lt;/p&gt;
&lt;p&gt;Also notice a few perhaps surprising things that entered the data model: safety and quality sensititivies. When you think about it, rideability isn&amp;rsquo;t just about &amp;ldquo;too muddy&amp;rdquo; or &amp;ldquo;has puddles,&amp;rdquo; there&amp;rsquo;s also a safety concern and a quality of ride concern. Skateparks are notably impossible to ride with any standing moisture, while mountain bike trails have a fairly wide range of acceptance that sometimes comes down to local rules (is it open?) and personal tolerance (how much mud is just annoying?). So the wet skatepark scenario is truly a safety risk, while the mountain bike scenario is more about am I damaging the trail and am I open to a mud ride.&lt;/p&gt;
&lt;p&gt;As an aside, it&amp;rsquo;s worth noting that I ride a local private mountain bike trail that gets so little traffic that mud isn&amp;rsquo;t a damage concern at all. We tend to invert the normal ride season and ride that trail specifically in less than ideal conditions, so it provided a bit of a logic stress test for the app. Often for this particular trail I&amp;rsquo;ll take a Maybe verdict as a green light given its unique properties.&lt;/p&gt;
&lt;h2 id="threshold-calibration-per-mode"&gt;Threshold Calibration Per Mode&lt;/h2&gt;
&lt;p&gt;When it comes to actually rendering a verdict, the verdict thresholds differ between wetness concern and dryness concern:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Yes&lt;/th&gt;
&lt;th&gt;Maybe&lt;/th&gt;
&lt;th&gt;No&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Wetness concern&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&amp;lt; 0.30&lt;/td&gt;
&lt;td&gt;0.30 – 0.60&lt;/td&gt;
&lt;td&gt;≥ 0.60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Dryness concern&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&amp;lt; 0.15&lt;/td&gt;
&lt;td&gt;0.15 – 0.45&lt;/td&gt;
&lt;td&gt;≥ 0.45&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Yardwise thresholds are shifted lower because the consequences are asymmetric. For a rider, going out on a borderline trail risks damaging the trail surface. For a gardener, missing one watering day rarely kills plants. The engine leans toward &amp;ldquo;maybe water&amp;rdquo; rather than &amp;ldquo;definitely water&amp;rdquo; because overwatering is its own problem.&lt;/p&gt;
&lt;p&gt;The sensitivity veto also inverts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Wetness concern:&lt;/strong&gt; If a sensitive surface (like natural grass with 0.9 damage sensitivity) gets a Maybe verdict with wetness above 0.4, it&amp;rsquo;s pushed to No. Protect the surface.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dryness concern:&lt;/strong&gt; If a sensitive surface (like fresh seed with 0.95 effective sensitivity) gets a Maybe verdict with wetness below 0.3, it&amp;rsquo;s pushed to Yes. Water the fragile plants.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Same mechanism, opposite direction. And yet one line of mode-aware logic handles both cases.&lt;/p&gt;
&lt;h2 id="app-specific-features-without-conditionals"&gt;App-Specific Features Without Conditionals&lt;/h2&gt;
&lt;p&gt;It&amp;rsquo;s worth pointing out that Yardwise has two features the other apps don&amp;rsquo;t: manual watering tracking and cold-weather dormancy suppression. Rather than branching on app identity, these are driven by the input data:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Manual watering&lt;/strong&gt; is an array of &lt;code&gt;WateringEvent&lt;/code&gt; values on the input struct. Ridewise and Fieldwise pass an empty array. The engine&amp;rsquo;s watering contribution calculation gracefully returns zero when there are no events, meaning no conditional needed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Establishment sensitivity&lt;/strong&gt; is a &lt;code&gt;Double&lt;/code&gt; on the input (0.0 by default). Yardwise sets it to 0.5 for newly seeded areas and 0.2 for newly planted ones, boosting the surface&amp;rsquo;s damage sensitivity. Ridewise and Fieldwise leave it at 0.0. Again, no branching for the apps that don&amp;rsquo;t care, the math just works with a zero boost.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cold-weather dormancy&lt;/strong&gt; activates when the temperature drops below 55°F. It injects additional &amp;ldquo;wetness&amp;rdquo; into the Yardwise calculation, suppressing watering recommendations when plants are dormant. This &lt;em&gt;is&lt;/em&gt; gated on &lt;code&gt;EngineMode.drynessConcern&lt;/code&gt; because the concept doesn&amp;rsquo;t make sense for riders given that cold weather doesn&amp;rsquo;t make trails &lt;em&gt;less wet&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;This is the one place where I accepted a mode check in the engine, and it was a pragmatic call. Dormancy is fundamentally a gardening concept. Trying to abstract it into a mode-agnostic mechanism would have added complexity without clarity.&lt;/p&gt;
&lt;h2 id="the-input-struct"&gt;The Input Struct&lt;/h2&gt;
&lt;p&gt;On to the engine inputs, where everything flows through a single input type:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-swift" data-lang="swift"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;struct&lt;/span&gt; &lt;span class="nc"&gt;GroundwiseInputs&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// Weather (required)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;rain24hInches&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Double&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;rain48hInches&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Double&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;rain72hInches&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Double&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;minutesSinceRainEnded&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Int&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;rainPattern&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RainPattern&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;temperatureF&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Double&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;sustainedWindMph&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Double&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;cloudCoverFraction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Double&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// Weather (optional, improves accuracy)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;gustsMph&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;dewPointF&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;relativeHumidity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;overnightLowF&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;daysSinceLastRain&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Int&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// Freeze/thaw context&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;frozenSnowAccumulationInches&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;hoursSinceThawBegan&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Int&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;hoursBelowFreezing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Int&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// Site context&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;siteType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;SiteType&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;surfaceType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;SurfaceType&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;exposureLevel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ExposureLevel&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// Mode and calibration&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;engineMode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;EngineMode&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;establishmentSensitivityBoost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Double&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;isCurrentlyPrecipitating&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Bool&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;hasThunderstorm&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Bool&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// Yardwise-specific&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;manualWateringEvents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;WateringEvent&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Each app constructs this from its own domain model. Ridewise fills in the weather data and its spot&amp;rsquo;s surface type. Yardwise adds watering events and an establishment boost. The engine doesn&amp;rsquo;t know or care which app called it.&lt;/p&gt;
&lt;h2 id="the-output-same-structure-different-meaning"&gt;The Output: Same Structure, Different Meaning&lt;/h2&gt;
&lt;p&gt;The engine evaluates the inputs as a black box and generates an assessment in this form:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-swift" data-lang="swift"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;struct&lt;/span&gt; &lt;span class="nc"&gt;GroundwiseAssessment&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;verdict&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Verdict&lt;/span&gt; &lt;span class="c1"&gt;// .yes / .maybe / .no&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;confidence&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Confidence&lt;/span&gt; &lt;span class="c1"&gt;// .low / .medium / .high&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;rationale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;GroundwiseRationale&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;riskSurfaceDamage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RiskLevel&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;riskActivitySafety&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RiskLevel&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;riskActivityQuality&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RiskLevel&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;recoveryOutlook&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RecoveryOutlook&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The consuming app interprets the verdict through its own lens. Ridewise renders Yes as &amp;ldquo;Dry — go ride.&amp;rdquo; Yardwise renders Yes as &amp;ldquo;Water today.&amp;rdquo; The engine provides the structured rationale (headline, decisive factor, contributing details), and each app&amp;rsquo;s UI formats it with domain-appropriate language.&lt;/p&gt;
&lt;p&gt;Risk levels work the same way. Surface damage risk on a trail means erosion and ruts. Surface damage risk on a newly seeded lawn means killing the seed. Same risk level, different consequence, the app handles the framing.&lt;/p&gt;
&lt;h2 id="what-id-do-differently"&gt;What I&amp;rsquo;d Do Differently&lt;/h2&gt;
&lt;p&gt;The engine&amp;rsquo;s one-file structure (2,193 lines in &lt;code&gt;GroundwiseEngine.swift&lt;/code&gt;) works but isn&amp;rsquo;t ideal. The frozen conditions check alone is 360 lines. If I were starting over, I&amp;rsquo;d break the pipeline into discrete stages: &lt;code&gt;FreezeAssessor&lt;/code&gt;, &lt;code&gt;PrecipitationAssessor&lt;/code&gt;, and &lt;code&gt;DryingCalculator&lt;/code&gt;, &lt;code&gt;VerdictResolver&lt;/code&gt;. And I&amp;rsquo;d make each of these a separate type with a clear protocol.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;d also make the threshold constants configurable per surface type rather than per engine mode. Right now, all wetness-concern surfaces share the same 0.3/0.6 thresholds. But a clay tennis court arguably deserves tighter thresholds than an artificial turf field. The sensitivity veto partially handles this, but explicit per-surface thresholds would be cleaner.&lt;/p&gt;
&lt;p&gt;That said, the current design has shipped and works. Premature refactoring is its own trap.&lt;/p&gt;
&lt;h2 id="the-tradeoff"&gt;The Tradeoff&lt;/h2&gt;
&lt;p&gt;Sharing an engine across three apps means accepting constraints:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;You can&amp;rsquo;t special-case easily.&lt;/strong&gt; If Ridewise needs a trail-specific behavior that doesn&amp;rsquo;t generalize, you either make it general enough for the shared engine or handle it in the app layer.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Testing surface area grows.&lt;/strong&gt; Every change to the engine needs to be validated against all three app contexts. A threshold tweak that improves Ridewise verdicts might break Yardwise scenarios.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Abstraction has a ceiling.&lt;/strong&gt; Cold-weather dormancy proved that not everything generalizes cleanly. Knowing when to accept a mode check instead of over-abstracting is a judgment call.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The upside: every improvement to the drying model benefits all three apps simultaneously. When I improved the residual wetness calculation for trails, clay tennis courts and garden beds got more accurate too because they share the same underlying property (absorbent surfaces retain moisture).&lt;/p&gt;
&lt;p&gt;For an indy developer maintaining three related apps, that leverage is worth the constraints.&lt;/p&gt;
&lt;h2 id="next-in-the-series"&gt;Next in the Series&lt;/h2&gt;
&lt;p&gt;The &lt;a href="https://stalefishlabs.com/read/2026-03-23-edge-cases/"
&gt;next article&lt;/a&gt; digs into the edge cases that make weather modeling humbling: freeze/thaw cycles, precipitation intensity, snow melt, and cold-weather plant dormancy. Each one is a lesson in how simple models break when they meet the real world.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;Ridewise, Fieldwise, and Yardwise are all available for iOS from &lt;a href="https://stalefishlabs.com"
target="_blank"
&gt;Stalefish Labs&lt;/a&gt;. Built by one developer, powered by one engine.&lt;/em&gt;&lt;/p&gt;</content:encoded><dc:creator>Michael Morrison</dc:creator><enclosure url="https://stalefishlabs.com/swiftengine.png" type="image/png" length="0"/></item><item><title>Turning Raw Weather Into a Drying Model</title><link>https://stalefishlabs.com/read/2026-03-17-drying-model/</link><pubDate>Tue, 17 Mar 2026 00:00:00 -0700</pubDate><guid>https://stalefishlabs.com/read/2026-03-17-drying-model/</guid><description>How we model surface drying after rain, and why a downpour and a drizzle leave very different trails.</description><content:encoded>&lt;p&gt;In the &lt;a href="https://stalefishlabs.com/read/2026-03-05-weather-engine-intro/"
&gt;first article&lt;/a&gt; about my foray into using weather data to assess surface conditions for riding activities, I introduced the Groundwise engine, a software decision system that turns weather data into a yes/maybe/no verdict for outdoor conditions. This article goes deeper into the core moisture model: how the engine takes raw weather observations and calculates a wetness score that drives the verdict. The hope is to show how a simple question such as &amp;ldquo;can I ride my mountain bike today?&amp;rdquo; spiraled into a fairly complex yet intriguing design challenge. Totally fair if you aren&amp;rsquo;t entranced by weather math, I get it, but I feel like there&amp;rsquo;s some value in pulling back the curtain to reveal how much goes into solving a seemingly simple problem.&lt;/p&gt;
&lt;p&gt;The Groundwise model is relatively restrainted in scope, it isn&amp;rsquo;t trying to simulate soil physics. It&amp;rsquo;s trying to approximate what an experienced local would know instinctively — &amp;ldquo;it rained pretty hard yesterday, but it&amp;rsquo;s been warm and windy all morning, so the trails are probably fine.&amp;rdquo; The goal is to encode that intuition into something repeatable and surface-aware.&lt;/p&gt;
&lt;h2 id="weighted-precipitation-not-all-rain-is-equal"&gt;Weighted Precipitation: Not All Rain Is Equal&lt;/h2&gt;
&lt;p&gt;The engine tracks precipitation across three time windows: the last 24 hours, 24-48 hours ago, and 48-72 hours ago. But it doesn&amp;rsquo;t treat them equally. Here&amp;rsquo;s how they are weighted differently by the weather precipitation equation:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;weatherPrecip = rain24h × 0.7 + (rain48h - rain24h) × 0.2 + (rain72h - rain48h) × 0.1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Recent rain dominates. An inch in the last 24 hours contributes seven times more to the score than an inch from two days ago. This matches real-world observation, where rain from three days ago has had significant time to drain and evaporate, while yesterday&amp;rsquo;s rain is still actively affecting conditions.&lt;/p&gt;
&lt;p&gt;The subtraction matters too. &lt;code&gt;rain48h&lt;/code&gt; is a &lt;em&gt;cumulative&lt;/em&gt; total (it includes the last 24 hours), so the formula isolates each window&amp;rsquo;s unique contribution. A half an inch total over 48 hours where all of it fell in the last 24 tells a very different story than half an inch spread evenly.&lt;/p&gt;
&lt;h3 id="rain-score-normalization"&gt;Rain Score Normalization&lt;/h3&gt;
&lt;p&gt;A recent rain results in a raw precipitation value that gets normalized to a 0-1 scale, so effectively a percentage:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;rainScore = min(1.0, totalPrecip / 0.75)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Three-quarters of an inch saturates the score (maximum value of 1, or 100%). Beyond that, more rain doesn&amp;rsquo;t make things &lt;em&gt;more&lt;/em&gt; wet from the engine&amp;rsquo;s perspective — you&amp;rsquo;re already at maximum precipitation/saturation, which matches reality in that a trail, yard, or any other outdoor surface has a limit to how wet it can get. This prevents a 3-inch deluge from producing a wildly different result than a 1-inch soaking. Both are &amp;ldquo;very wet&amp;rdquo; — the distinction that matters is how long ago it happened and how fast things are drying.&lt;/p&gt;
&lt;h3 id="why-intensity-matters"&gt;Why Intensity Matters&lt;/h3&gt;
&lt;p&gt;The engine tracks rain pattern: light, steady, or downpour. It then applies a multiplier to the base wetness given one of those patterns:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Multiplier&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Light&lt;/td&gt;
&lt;td&gt;0.7x&lt;/td&gt;
&lt;td&gt;Gentle rain soaks in gradually, less runoff, less surface pooling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Steady&lt;/td&gt;
&lt;td&gt;1.1x&lt;/td&gt;
&lt;td&gt;Sustained saturation, ground can&amp;rsquo;t keep up&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Downpour&lt;/td&gt;
&lt;td&gt;1.5x&lt;/td&gt;
&lt;td&gt;Overwhelms drainage, causes pooling and surface flooding&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A quarter inch of light rain over several hours is genuinely different from a quarter inch dumped in 20 minutes. The light rain absorbs more evenly. The downpour creates surface water, overwhelms drainage on absorbent surfaces, and can cause erosion on trails.&lt;/p&gt;
&lt;h2 id="drying-strength-the-recovery-side"&gt;Drying Strength: The Recovery Side&lt;/h2&gt;
&lt;p&gt;Wetness is only half the picture. The other half is how aggressively conditions are drying things out. The engine calculates a composite drying strength from four weather factors:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;drying = (tempFactor × 0.30) + (windFactor × 0.30) + (humidityFactor × 0.25) + (skyFactor × 0.15)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Temperature (30% weight):&lt;/strong&gt; Warmer air holds more moisture and drives evaporation. The factor scales linearly from 0 at 50°F to 1.0 at 90°F. Below 50°F, evaporation slows dramatically. Above 90°F, you&amp;rsquo;re drying as fast as conditions allow.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;tempFactor = clamp((tempF - 50) / 40, 0, 1)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Wind (30% weight):&lt;/strong&gt; Moving air carries moisture away from surfaces. Scales linearly up to 20 mph, where the effect plateaus - going from 20 to 40 mph doesn&amp;rsquo;t double the drying rate.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;windFactor = clamp(sustainedWindMph / 20, 0, 1)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Humidity (25% weight):&lt;/strong&gt; Dry air absorbs moisture more readily. This is the inverse, where low humidity means strong drying.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;humidityFactor = clamp(1.0 - effectiveHumidity, 0, 1)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When the weather API provides a dew point instead of relative humidity, the engine converts it using the Magnus formula. Dew point is actually the more reliable measurement — relative humidity fluctuates throughout the day even when actual moisture content stays constant.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sky cover (15% weight):&lt;/strong&gt; Clear skies mean solar radiation hitting surfaces directly, which drives evaporation. Clouds block that. This gets the lowest weight because its effect is real but smaller than the others.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;skyFactor = clamp(1.0 - cloudCover, 0, 1)
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="exposure-matters"&gt;Exposure Matters&lt;/h3&gt;
&lt;p&gt;All of this gets modified by where the surface actually sits. A trail under heavy tree canopy dries differently than an open field fully exposed to sunlight:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Exposure&lt;/th&gt;
&lt;th&gt;Rain Multiplier&lt;/th&gt;
&lt;th&gt;Drying Multiplier&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Exposed&lt;/td&gt;
&lt;td&gt;1.0x&lt;/td&gt;
&lt;td&gt;1.0x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shaded&lt;/td&gt;
&lt;td&gt;0.7x&lt;/td&gt;
&lt;td&gt;0.6x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Covered&lt;/td&gt;
&lt;td&gt;0.0x&lt;/td&gt;
&lt;td&gt;0.8x&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Shaded spots get less rain (canopy intercepts 30%) but also dry 40% slower (less sun, less wind). Covered spots (under a roof or overhang) get no rain at all but still have air circulation for moderate drying.&lt;/p&gt;
&lt;p&gt;This creates an interesting dynamic: a shaded trail might actually be &lt;em&gt;drier&lt;/em&gt; than an exposed one after light rain (less water reached it) but &lt;em&gt;wetter&lt;/em&gt; after heavy rain (the rain that got through takes longer to leave).&lt;/p&gt;
&lt;h3 id="drying-classification"&gt;Drying Classification&lt;/h3&gt;
&lt;p&gt;The composite score maps to three tiers, each returning a fixed drying effectiveness value:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Score Range&lt;/th&gt;
&lt;th&gt;Classification&lt;/th&gt;
&lt;th&gt;Effectiveness&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;≥ 0.7&lt;/td&gt;
&lt;td&gt;Strong&lt;/td&gt;
&lt;td&gt;0.8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.4 – 0.7&lt;/td&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;0.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt; 0.4&lt;/td&gt;
&lt;td&gt;Weak&lt;/td&gt;
&lt;td&gt;0.2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;I deliberately chose discrete tiers over a continuous curve. The difference between a 0.41 and a 0.69 drying score isn&amp;rsquo;t meaningful in practice — both represent &amp;ldquo;conditions are helping somewhat.&amp;rdquo; The tiers prevent false precision while still capturing the real distinction between &amp;ldquo;sunny and breezy&amp;rdquo; (strong), &amp;ldquo;overcast and mild&amp;rdquo; (moderate), and &amp;ldquo;cold, humid, and still&amp;rdquo; (weak).&lt;/p&gt;
&lt;h2 id="combining-it-all-the-wetness-score"&gt;Combining It All: The Wetness Score&lt;/h2&gt;
&lt;p&gt;I warned you this problem has more nuance that it would seem. But hang in there, we&amp;rsquo;re getting closer to arriving at some meaningful mathematical conclusions. For example, the wetness score blends precipitation and drying into a single 0-1 value:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;baseWetness = rainScore × 0.5 + (rainScore × timingScore) × 0.6
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This formula does something subtle. The first term (&lt;code&gt;rainScore × 0.5&lt;/code&gt;) ensures that heavy rain always contributes &lt;em&gt;some&lt;/em&gt; wetness regardless of timing. The second term (&lt;code&gt;rainScore × timingScore&lt;/code&gt;) captures the interaction — recent heavy rain is much worse than old heavy rain. The timing score decays linearly from 1.0 (just stopped) to 0.0 (24+ hours ago).&lt;/p&gt;
&lt;p&gt;After the base calculation, the rain pattern multiplier is applied (0.7x for light, 1.1x for steady, 1.5x for downpour), then drying reduces it:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;dryingEffect = dryingScore × 0.3 × dryingEffectiveness
wetness = baseWetness × (1.0 - dryingEffect)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The &lt;code&gt;dryingEffectiveness&lt;/code&gt; factor prevents drying from being too aggressive when rain just ended. If rain stopped 30 minutes ago, even strong drying conditions haven&amp;rsquo;t had time to do much yet. The factor scales up as time passes, so drying&amp;rsquo;s impact grows the longer it&amp;rsquo;s been since rain.&lt;/p&gt;
&lt;h3 id="a-worked-example"&gt;A Worked Example&lt;/h3&gt;
&lt;p&gt;To put all these equations into perspective, let&amp;rsquo;s trace through a real scenario to arrive at a Groundwise verdict: &lt;strong&gt;0.4 inches of steady rain ended 8 hours ago. It&amp;rsquo;s 72°F, 12 mph wind, 45% humidity, 20% cloud cover. Exposed dirt trail.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Rain score:&lt;/strong&gt;&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;weatherPrecip = 0.4 × 0.7 = 0.28 (all in last 24h)
rainScore = min(1.0, 0.28 / 0.75) = 0.37
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Timing score:&lt;/strong&gt;&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;hours = 480 min / 60 = 8
timingScore = max(0, 1.0 - 8/24) = 0.67
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Drying strength:&lt;/strong&gt;&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;temp = (72-50)/40 × 0.30 = 0.165
wind = 12/20 × 0.30 = 0.18
humidity = 0.55 × 0.25 = 0.1375
sky = 0.80 × 0.15 = 0.12
total = 0.60 → Moderate (effectiveness = 0.5)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Wetness:&lt;/strong&gt;&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;base = 0.37 × 0.5 + (0.37 × 0.67) × 0.6 = 0.185 + 0.149 = 0.334
× steady pattern (1.1) = 0.367
dryingEffectiveness = max(0.2, 1.0 - 0.67 × 0.5) = 0.665
dryingEffect = 0.5 × 0.3 × 0.665 = 0.10
wetness = 0.367 × (1.0 - 0.10) = 0.33
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Verdict: Maybe&lt;/strong&gt; (0.33 is just above the 0.3 threshold). The trail is borderline — rideable but still damp. On a dirt trail (damage sensitivity 0.5), the sensitivity veto wouldn&amp;rsquo;t trigger. A reasonable call either way, and the engine goes with Maybe, giving the rider the opportunity to then weigh locale-specific details such as trail sensitivity to damage.&lt;/p&gt;
&lt;p&gt;Now change one variable — make it 85°F instead of 72°F:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;temp = (85-50)/40 × 0.30 = 0.2625
total drying = 0.70 → Strong (effectiveness = 0.8)
dryingEffect = 0.8 × 0.3 × 0.665 = 0.16
wetness = 0.367 × (1.0 - 0.16) = 0.308
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Still Maybe, but barely. A bit more wind or another hour of drying and it flips to Yes. That matches intuition — a hot afternoon pulls moisture out fast.&lt;/p&gt;
&lt;h2 id="residual-wetness-the-ground-remembers"&gt;Residual Wetness: The Ground Remembers&lt;/h2&gt;
&lt;p&gt;The timing-based model handles most scenarios well, but it has a blind spot: &lt;strong&gt;ground saturation after heavy rain on absorbent surfaces.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If it rained an inch on Monday and you&amp;rsquo;re checking the trail on Wednesday, the timing score says &amp;ldquo;it&amp;rsquo;s been 48 hours, moisture contribution is minimal.&amp;rdquo; But anyone who&amp;rsquo;s walked a clay trail two days after heavy rain knows that&amp;rsquo;s wrong. The ground is still holding water.&lt;/p&gt;
&lt;p&gt;The engine adds a residual wetness component for absorbent surfaces (dirt, grass, clay, amended soil) when precipitation exceeded 0.25 inches:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;volumeFactor = clamp((rain - 0.25) / 0.75, 0, 1)
decayFactor = based on hours since rain and drying strength
surfaceRetention = inverse of surface drying multiplier
dryingReduction = strength-based reduction
residualWetness = 0.55 × volumeFactor × decayFactor × surfaceRetention × (1.0 - dryingReduction)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The peak residual value of ~0.55 deliberately sits in the middle of the Maybe range. It&amp;rsquo;s not enough to trigger a hard No, but it keeps the engine from prematurely saying Yes on saturated ground.&lt;/p&gt;
&lt;p&gt;Clay surfaces (drying multiplier 0.7x) retain the most residual moisture. Concrete and metal (2.0x+) don&amp;rsquo;t get residual wetness at all, they&amp;rsquo;re draining surfaces that hold little (concrete) to no (metal) water.&lt;/p&gt;
&lt;h2 id="what-this-model-doesnt-do"&gt;What This Model Doesn&amp;rsquo;t Do&lt;/h2&gt;
&lt;p&gt;A few things I intentionally left out:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Soil type modeling.&lt;/strong&gt; Real evapotranspiration models account for soil composition, drainage rates, water table depth. The engine uses surface type as a proxy instead. A dirt trail in sandy Arizona soil dries differently than one in Georgia red clay, and the engine can&amp;rsquo;t distinguish them. The tradeoff is simplicity — asking users to classify their soil composition seemed like a bridge too far. If you disagree, let us know, but I decided to err on the side of simplicity at least in terms of user inputs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Microclimate effects.&lt;/strong&gt; Two spots a mile apart can have meaningfully different conditions. The engine uses a single weather observation for each saved location, which might come from a station several miles away. Elevation, valley effects, and urban heat islands aren&amp;rsquo;t modeled.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Drainage infrastructure.&lt;/strong&gt; A well-designed trail with proper drainage handles rain better than a flat trail in a depression. An athletic field with subsurface drainage is ready for play sooner than one without. The engine doesn&amp;rsquo;t know about this. Surface type captures some of it (artificial turf implies drainage engineering), but it&amp;rsquo;s imperfect.&lt;/p&gt;
&lt;p&gt;These are all real limitations, and I&amp;rsquo;d rather be transparent about them than pretend the model is more precise than it is. The engine targets &amp;ldquo;better than guessing&amp;rdquo; — not &amp;ldquo;better than walking over and checking yourself.&amp;rdquo;&lt;/p&gt;
&lt;h2 id="next-in-the-series"&gt;Next in the Series&lt;/h2&gt;
&lt;p&gt;The &lt;a href="https://stalefishlabs.com/read/2026-03-19-one-engine-three-apps/"
&gt;next article&lt;/a&gt; covers how this engine is packaged as a shared Swift framework consumed by three different apps — each with its own surface library, threshold calibration, and verdict interpretation. Same core math, three different products. It&amp;rsquo;s a lesson in code reuse, and the benefits of solving a problem once in just a general enough way to apply that solution multiple times.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;The drying model powers &lt;a href="https://stalefishlabs.com/use/ridewise/"
target="_blank"
&gt;Ridewise&lt;/a&gt;, &lt;a href="https://stalefishlabs.com/use/fieldwise/"
target="_blank"
&gt;Fieldwise&lt;/a&gt;, and &lt;a href="https://stalefishlabs.com/use/yardwise/"
target="_blank"
&gt;Yardwise&lt;/a&gt; — all available for iOS from &lt;a href="https://stalefishlabs.com"
target="_blank"
&gt;Stalefish Labs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;</content:encoded><dc:creator>Michael Morrison</dc:creator><enclosure url="https://stalefishlabs.com/floodedgrass.png" type="image/png" length="0"/></item><item><title>I Built a Weather Engine That Tells You When to Ride, Play, or Water</title><link>https://stalefishlabs.com/read/2026-03-12-weather-engine-intro/</link><pubDate>Thu, 12 Mar 2026 00:00:00 -0700</pubDate><guid>https://stalefishlabs.com/read/2026-03-12-weather-engine-intro/</guid><description>One decision engine, three audiences: a yes/maybe/no verdict for riders, rec league players, and gardeners.</description><content:encoded>&lt;p&gt;Every mountain biker knows the ritual. It rained last night. You check the radar, clear now. You check the trail association&amp;rsquo;s Facebook page, nobody&amp;rsquo;s posted. You text your riding buddy: &amp;ldquo;Think the trails are good?&amp;rdquo; They don&amp;rsquo;t know either. So you either stay home and miss a perfectly rideable day, or show up and chew through muddy trails that needed another six hours to dry.&lt;/p&gt;
&lt;p&gt;I got tired of guessing so I built a weather decision engine that answers the question directly: &lt;strong&gt;is it too wet to ride?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Then I realized the same engine could answer two more questions: &lt;strong&gt;is this field playable?&lt;/strong&gt; and &lt;strong&gt;does my garden need watering?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This is the story of the Groundwise engine, a single Swift package that powers three iOS apps by asking the same underlying question from different perspectives.&lt;/p&gt;
&lt;h2 id="the-problem-with-did-it-rain"&gt;The Problem With &amp;ldquo;Did It Rain?&amp;rdquo;&lt;/h2&gt;
&lt;p&gt;Weather apps mostly tell you what &lt;em&gt;will&lt;/em&gt; happen, and to a lesser degree they can tell you &lt;em&gt;what&lt;/em&gt; happened. What they don&amp;rsquo;t tell you is &lt;em&gt;what it means&lt;/em&gt; for the specific thing you want to do.&lt;/p&gt;
&lt;p&gt;Half an inch of rain means completely different things depending on context:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On a &lt;strong&gt;concrete skatepark&lt;/strong&gt;, it sheds in a couple hours. You&amp;rsquo;re probably fine by afternoon.&lt;/li&gt;
&lt;li&gt;On a &lt;strong&gt;dirt trail&lt;/strong&gt;, it might need 24 hours with good sun and wind. Or 48 hours or more if it&amp;rsquo;s overcast and cold.&lt;/li&gt;
&lt;li&gt;On a &lt;strong&gt;clay tennis court&lt;/strong&gt;, you might be waiting even longer, clay holds moisture and damages easily when wet.&lt;/li&gt;
&lt;li&gt;In a &lt;strong&gt;container garden on a sunny patio&lt;/strong&gt;, that half inch drained through the potting mix hours ago and your herbs might need water again tomorrow.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The answer isn&amp;rsquo;t just &amp;ldquo;how much rain,&amp;rdquo; it&amp;rsquo;s how much rain, on what surface, how long ago, and what the drying conditions have been since.&lt;/p&gt;
&lt;h2 id="from-weather-data-to-a-verdict"&gt;From Weather Data to a Verdict&lt;/h2&gt;
&lt;p&gt;So I built a weather analysis engine that takes in a handful of weather observations and produces a single categorical verdict regarding an action on a specific surface: &lt;strong&gt;Yes&lt;/strong&gt;, &lt;strong&gt;Maybe&lt;/strong&gt;, or &lt;strong&gt;No&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The inputs are straightforward, stuff you&amp;rsquo;d get from any weather API:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Precipitation totals (last 24, 48, and 72 hours)&lt;/li&gt;
&lt;li&gt;How long since rain ended&lt;/li&gt;
&lt;li&gt;Whether it was light, steady, or a downpour&lt;/li&gt;
&lt;li&gt;Current temperature, wind speed, humidity, and cloud cover&lt;/li&gt;
&lt;li&gt;Whether it&amp;rsquo;s actively raining right now&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Plus one critical piece of context: &lt;strong&gt;what surface are you asking about?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The engine defines 17 surface types across three categories. Each has a drying multiplier that controls how fast moisture clears, for example:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Surface&lt;/th&gt;
&lt;th&gt;Drying Speed&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Metal skateboard ramps&lt;/td&gt;
&lt;td&gt;2.8x&lt;/td&gt;
&lt;td&gt;Fastest, sheds water, heats up quickly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Artificial turf&lt;/td&gt;
&lt;td&gt;2.5x&lt;/td&gt;
&lt;td&gt;Engineered to drain&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Asphalt&lt;/td&gt;
&lt;td&gt;2.2x&lt;/td&gt;
&lt;td&gt;Dark surface, absorbs heat&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Concrete&lt;/td&gt;
&lt;td&gt;2.0x&lt;/td&gt;
&lt;td&gt;Drains well, slower to heat than asphalt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Potting mix&lt;/td&gt;
&lt;td&gt;2.0x&lt;/td&gt;
&lt;td&gt;Loose, fast-draining soil&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Compost&lt;/td&gt;
&lt;td&gt;1.2x&lt;/td&gt;
&lt;td&gt;Active decomposition generates some heat&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dirt/ground&lt;/td&gt;
&lt;td&gt;1.0x&lt;/td&gt;
&lt;td&gt;Baseline, absorbs and holds water&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Natural grass&lt;/td&gt;
&lt;td&gt;1.0x&lt;/td&gt;
&lt;td&gt;Root systems retain moisture&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Amended soil (mulched)&lt;/td&gt;
&lt;td&gt;0.7x&lt;/td&gt;
&lt;td&gt;Mulch deliberately slows evaporation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Clay&lt;/td&gt;
&lt;td&gt;0.7x&lt;/td&gt;
&lt;td&gt;Dense, holds water, slow to release&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;That 4x difference between metal and clay isn&amp;rsquo;t just a number, it&amp;rsquo;s the difference between &amp;ldquo;rideable in an hour&amp;rdquo; and &amp;ldquo;unplayable until tomorrow.&amp;rdquo;&lt;/p&gt;
&lt;h2 id="the-decision-pipeline"&gt;The Decision Pipeline&lt;/h2&gt;
&lt;p&gt;The engine runs checks in a specific order, with the most critical conditions evaluated first:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Is the ground frozen?&lt;/strong&gt; If there&amp;rsquo;s an ice or snow hazard, the verdict is No regardless of moisture. This check alone is about 360 lines of code, freeze/thaw cycles are surprisingly complex. A concrete skatepark clears ice in 6 hours at 55°F, but a dirt trail might need 72 hours at 45°F to fully thaw and dry.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Is it actively raining?&lt;/strong&gt; Straightforward gate. If precipitation is falling, the answer is No (or Maybe for very light drizzle on a fast-draining surface with strong drying conditions).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Calculate a wetness score.&lt;/strong&gt; This is where the real modeling happens. The engine combines:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;rain score&lt;/strong&gt; weighted toward recent precipitation (70% from last 24h, 20% from 24-48h, 10% from 48-72h)&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;timing score&lt;/strong&gt; that decays linearly over 24 hours since rain ended&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;drying strength&lt;/strong&gt; composite that factors in temperature, wind, humidity, and cloud cover&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Residual wetness&lt;/strong&gt; for absorbent surfaces, heavy rain on dirt or clay retains moisture well beyond what the timing score captures&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;4. Apply the verdict thresholds.&lt;/strong&gt; A wetness score below 0.3 means Yes (dry enough). Between 0.3 and 0.6 means Maybe (borderline). Above 0.6 means No (too wet).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;5. Sensitivity veto.&lt;/strong&gt; High-sensitivity surfaces (like newly seeded lawns or natural grass athletic fields) get pushed from Maybe toward a more protective verdict. The engine would rather tell you to wait than let you damage a surface that&amp;rsquo;s expensive to repair.&lt;/p&gt;
&lt;h2 id="one-engine-two-perspectives"&gt;One Engine, Two Perspectives&lt;/h2&gt;
&lt;p&gt;If you&amp;rsquo;re wondering how the above, which is described in terms of &lt;strong&gt;using&lt;/strong&gt; a surface, could possibly apply to a container garden, it&amp;rsquo;s a fair question. And this is where the engine morphed into serving a series of apps instead of just one:&lt;/p&gt;
&lt;p&gt;The engine calculates a &lt;strong&gt;wetness score&lt;/strong&gt;. For riders and athletes, high wetness is bad, you want dry conditions. For gardeners, high wetness is good, it means you can skip watering.&lt;/p&gt;
&lt;p&gt;Same math, opposite interpretation:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Wetness Score&lt;/th&gt;
&lt;th&gt;Rider/Athlete View&lt;/th&gt;
&lt;th&gt;Gardener View&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Low (&amp;lt; 0.3)&lt;/td&gt;
&lt;td&gt;Yes, go ride!&lt;/td&gt;
&lt;td&gt;Yes, water today&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Medium (0.3-0.6)&lt;/td&gt;
&lt;td&gt;Maybe, check conditions&lt;/td&gt;
&lt;td&gt;Maybe, check soil&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;High (&amp;gt; 0.6)&lt;/td&gt;
&lt;td&gt;No, too wet&lt;/td&gt;
&lt;td&gt;No, skip watering&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The engine calls this &lt;code&gt;EngineMode&lt;/code&gt;, either &lt;code&gt;wetnessConcern&lt;/code&gt; or &lt;code&gt;drynessConcern&lt;/code&gt;. A single enum that flips the entire interpretation layer while keeping the underlying moisture model identical.&lt;/p&gt;
&lt;p&gt;Yardwise (the gardening app) uses slightly shifted thresholds, 0.15 and 0.45 instead of 0.3 and 0.6, because the stakes of getting it wrong are lower. Missing a watering day is a mild inconvenience. Riding a muddy trail damages the trail. Playing softball on a muddy clay infield isn&amp;rsquo;t great. You get the idea.&lt;/p&gt;
&lt;h2 id="why-not-just-show-a-percentage"&gt;Why Not Just Show a Percentage?&lt;/h2&gt;
&lt;p&gt;Early versions of the apps showed a moisture percentage, and it wasn&amp;rsquo;t good. I didn&amp;rsquo;t know what to do with &amp;ldquo;the trail is at 47% moisture.&amp;rdquo; Is that rideable? It depends on the surface, on your own risk/comfort tolerance, on whether you care about trail damage, etc. A percentage pushes the decision back onto the user, which is exactly the problem the app was supposed to solve.&lt;/p&gt;
&lt;p&gt;The solution was to simplify down to three states: Yes/Maybe/No, with an explanation of &lt;em&gt;why&lt;/em&gt;. The Maybe state exists specifically for conditions where reasonable people would disagree. I have near me both public and private mountain bike trails, and the tolerance for mud varies widely based on level of traffic, so Maybe is when deferring to rider&amp;rsquo;s judgement is actually correct. The engine shows you the contributing factors (temperature is helping, but humidity is holding things back, for example) so you can make the final call.&lt;/p&gt;
&lt;p&gt;Each verdict also carries a &lt;strong&gt;confidence level&lt;/strong&gt; (Low, Medium, High). Confidence drops when timing data is missing, when rain has been patchy and unpredictable, or when the wetness score lands right on a threshold boundary.&lt;/p&gt;
&lt;h2 id="whats-coming-in-this-series"&gt;What&amp;rsquo;s Coming in This Series&lt;/h2&gt;
&lt;p&gt;If you find talk of drying multipliers and residual wetness scores riveting, then hold on to your butts! This is merely the first article in a series about building the Groundwise engine. Coming up:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Turning Raw Weather Into a Drying Model&lt;/strong&gt; - The math behind drying strength, residual wetness, and why rain intensity matters as much as total accumulation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One Engine, Three Apps&lt;/strong&gt; - How to structure a Swift package that serves multiple products with different surface libraries and threshold calibrations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Edge Cases That Break Your Weather Model&lt;/strong&gt; - Freeze/thaw cycles, cold-weather plant dormancy, the surprising complexity of &amp;ldquo;is snow melting?&amp;rdquo;, and dispatches from the great Nashville ice storm of 2026&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flipping the Question&lt;/strong&gt; - How the Yardwise inversion works, including manual watering tracking and evaporative demand suppression&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Building Confidence Into Uncertain Verdicts&lt;/strong&gt; - Why three states beat a percentage, and how to communicate uncertainty without creating anxiety&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="the-apps"&gt;The Apps&lt;/h2&gt;
&lt;p&gt;The Groundwise engine powers three apps, all available for iOS:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stalefishlabs.com/use/ridewise/"
target="_blank"
&gt;&lt;strong&gt;Ridewise&lt;/strong&gt;&lt;/a&gt;, ride conditions for trails, skateparks, bike parks, and pump tracks&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stalefishlabs.com/use/fieldwise/"
target="_blank"
&gt;&lt;strong&gt;Fieldwise&lt;/strong&gt;&lt;/a&gt;, field conditions for rec league sports on grass, turf, clay, and hard courts&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stalefishlabs.com/use/yardwise/"
target="_blank"
&gt;&lt;strong&gt;Yardwise&lt;/strong&gt;&lt;/a&gt;, watering guidance for casual gardeners with lawns, beds, and containers&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All three are built by &lt;a href="https://stalefishlabs.com"
target="_blank"
&gt;Stalefish Labs&lt;/a&gt;, a small indie studio focused on simple tools for getting outside and doing things together.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;If you&amp;rsquo;ve built something that turns raw data into human decisions, I&amp;rsquo;d love to hear how you approached the threshold and confidence problem. Drop a comment or find us on &lt;a href="https://bsky.app/profile/stalefishlabs.bsky.social"
target="_blank"
&gt;Bluesky&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;</content:encoded><dc:creator>Michael Morrison</dc:creator><enclosure url="https://stalefishlabs.com/mtbstorm.png" type="image/png" length="0"/></item></channel></rss>