<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Alfred Chaos]]></title><description><![CDATA[Alfred Chaos]]></description><link>https://alfredchaos.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Tue, 24 Nov 2026 13:17:27 GMT</lastBuildDate><atom:link href="https://alfredchaos.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[An export is a promise the app has to keep after you leave]]></title><description><![CDATA[Every app claims your data is yours. The claim is testable in about ten minutes: ask for a copy, then try to live without the app for a day. For a period…]]></description><link>https://alfredchaos.hashnode.dev/an-export-is-a-promise-the-app-has-to-keep-after-you-leave</link><guid isPermaLink="true">https://alfredchaos.hashnode.dev/an-export-is-a-promise-the-app-has-to-keep-after-you-leave</guid><category><![CDATA[Android]]></category><category><![CDATA[privacy]]></category><category><![CDATA[data]]></category><dc:creator><![CDATA[Alfred Chaos]]></dc:creator><pubDate>Sat, 21 Nov 2026 23:56:51 GMT</pubDate><content:encoded><![CDATA[<p>Every app claims your data is yours. The claim is testable in about ten minutes: ask for a copy, then try to live without the app for a day.</p>
<p>For a period tracker the copy matters more than usual. The record is a timeline you built over months, and it is the only input to every estimate the app makes. If the export is a screenshot of a dashboard, the timeline is gone the moment you switch phones.</p>
<h2>Three readers, three formats</h2>
<p>A useful export serves three different readers.</p>
<ul>
<li><strong>The app itself.</strong> A structured file (JSON) it can import back. This is the only format that proves portability rather than mere backup.</li>
<li><strong>A spreadsheet.</strong> CSV, one row per event or per day, with a header row a person can read.</li>
<li><strong>A human.</strong> A summary in prose or a small table. This is the file you hand to a doctor's appointment, or read at 2 a.m. when you are trying to remember when the last three cycles started.</li>
</ul>
<p>I have seen exports that offer only the first. That is a backup, not an exit.</p>
<h2>What I check inside the file</h2>
<ol>
<li><strong>Dates, not timestamps.</strong> A period day is a calendar day. If the file stores <code>2026-11-03T00:00:00Z</code>, the value will drift by a day when the reader's timezone changes.</li>
<li><strong>Contiguous ranges or explicit days, not both half-way.</strong> Either list every marked day, or list ranges with an inclusive start and end. Mixing the two invites off-by-one bugs.</li>
<li><strong>No derived values posing as records.</strong> Predictions should be absent or clearly labelled. If a predicted day sits in the same column as a logged day, the import will slowly turn guesses into history.</li>
<li><strong>Readable keys.</strong> If the only key is an opaque ID, the file is readable by exactly one program.</li>
<li><strong>A documented unit.</strong> "Length: 5" is ambiguous. "Period length: 5 days" is not.</li>
</ol>
<h2>Import is the other half</h2>
<p>Export without import is a one-way door. The test: export on one device, import on a clean install, and compare the calendar day by day. If the import screen exists but silently drops the oldest cycle, you will find out years later.</p>
<p>It is also worth checking what uninstalling does. On Android, removing an app normally deletes its local database. That is the correct behaviour for deletion, and the reason an export should be the first thing you do before changing phones.</p>
<h2>Why this is an engineering choice, not a feature</h2>
<p>An export format is a schema with a compatibility promise. The moment someone imports a file, every future version has to read it. That is why exports get deprioritised: they are cheap to write once and expensive to keep honest.</p>
<p>The cheap version is a dump of the internal database. The honest version is a small, documented format with a version number, plus an importer that treats old files as first-class input.</p>
<p><em>I work on <a href="https://www.moricycle.com/">Mori</a>, a period tracker for Android. Its export comes as JSON, CSV or a readable summary, and the summary is the format I actually re-read.</em></p>
<p><em>Written with AI assistance.</em></p>
]]></content:encoded></item><item><title><![CDATA[The tests we run on period math]]></title><description><![CDATA[Most bugs in a period tracker are not visual bugs. They are one day off. Someone logs a period at 11:40 pm on March 1. Stored as a timestamp and rendered…]]></description><link>https://alfredchaos.hashnode.dev/the-tests-we-run-on-period-math</link><guid isPermaLink="true">https://alfredchaos.hashnode.dev/the-tests-we-run-on-period-math</guid><category><![CDATA[Android]]></category><category><![CDATA[privacy]]></category><category><![CDATA[Testing]]></category><dc:creator><![CDATA[Alfred Chaos]]></dc:creator><pubDate>Sun, 15 Nov 2026 00:00:32 GMT</pubDate><content:encoded><![CDATA[<p>Most bugs in a period tracker are not visual bugs. They are one day off.</p>
<p>Someone logs a period at 11:40 pm on March 1. Stored as a timestamp and rendered somewhere else, that date can come back as February 28. Every number downstream moves with it: cycle length, the next start, the "fertile window" that should never have been treated as a contraceptive signal in the first place.</p>
<p>So the first rule is boring and absolute: a period date is a calendar date. No time of day, no timezone, no conversion. The second rule follows from it: the prediction code never reads the clock — it takes an as-of date as an argument.</p>
<p>Those two rules turn most of this product into things you can assert in tests. Here are the invariants I actually lock down.</p>
<p><strong>1. Contiguous days are one period.</strong> Five logged days in a row are one period of five days, not five periods. Delete the Wednesday in the middle and the tests expect two periods. The split is a real product decision, not a rendering trick.</p>
<p><strong>2. Month and year boundaries need no special cases.</strong> February 28 to March 1 is two days in 2026 and three in 2028, because of the leap day. December 31 to January 1 is two days in any year. If those dates are plain calendar days, the arithmetic just works; if they are timestamps, they become a source of off-by-one bugs that only appear once a year.</p>
<p><strong>3. Only complete cycles count.</strong> A cycle is the gap between one period start and the next. The current, unfinished cycle never enters the average — otherwise the number is wrong every day until the next period starts, and it looks like the app is drifting when it is only counting a half-finished interval.</p>
<p><strong>4. Predictions are a function of inputs.</strong> Same cycles, same settings, same as-of date, same output — every run. When a test fails I can reproduce the exact date it failed on, because "today" is not baked into the code.</p>
<p><strong>5. Odd intervals stay in the record.</strong> A 19-day gap and a 47-day gap are facts the user recorded. The test asserts that we keep them and lower the confidence label, instead of trimming them out of the average to look tidy. Quietly flattening the data is how a tracker ends up confident and wrong.</p>
<p><strong>6. One prediction, several surfaces.</strong> Calendar, cycle ring and reminder schedule read the same computed result. The test that matters is the dull one: change one logged day, and all three move together.</p>
<p>What this buys is not accuracy beyond what the data supports. Two cycles in, the range is wide and the confidence label says so; that is the honest output, not a failure mode. What the tests buy is that the same input always produces the same dates — and when something does break, it breaks as a failed assertion instead of a plausible-looking wrong day on someone's calendar.</p>
<p>I build Mori, a period tracker for Android. The rules above are what the app ships: <a href="https://www.moricycle.com/">https://www.moricycle.com/</a></p>
<h2>Do these tests make the prediction accurate?</h2>
<p>No. They make it reproducible and honest about its own uncertainty. With two cycles of history the range is wide and the confidence label is low, because that is all the data supports. Tests cannot manufacture a narrower range; they can only stop the app from inventing one.</p>
]]></content:encoded></item><item><title><![CDATA[Why our predictions only look at your last six cycles]]></title><description><![CDATA[If you've logged periods for three years, an app has thirty-something cycles of history to work with. Which of those should the next prediction use? We cap…]]></description><link>https://alfredchaos.hashnode.dev/why-our-predictions-only-look-at-your-last-six-cycles</link><guid isPermaLink="true">https://alfredchaos.hashnode.dev/why-our-predictions-only-look-at-your-last-six-cycles</guid><category><![CDATA[privacy]]></category><category><![CDATA[Android]]></category><category><![CDATA[health]]></category><dc:creator><![CDATA[Alfred Chaos]]></dc:creator><pubDate>Sat, 07 Nov 2026 23:58:09 GMT</pubDate><content:encoded><![CDATA[<p>If you've logged periods for three years, an app has thirty-something cycles of history to work with. Which of those should the next prediction use?</p>
<p>We cap the window at your six most recent cycles. That's a product decision, not a law of statistics, so here's the reasoning.</p>
<h2>More history isn't automatically better</h2>
<p>A cycle length from 2023 is a fact about 2023. Bodies change with age, weight, stress, medication and sleep, and a two-year-old average quietly mixes states that no longer describe you.</p>
<p>Six cycles is roughly half a year. Long enough that one unusual month doesn't dominate the average, short enough that the estimate stays about the present. That's the whole argument for the number.</p>
<h2>What counts as a usable cycle</h2>
<p>We only use complete cycles: a recorded start date, and a recorded start for the following one. A cycle length is the number of calendar days between those two dates.</p>
<p>Two details that sound boring and matter:</p>
<ul>
<li><strong>Days, not timestamps.</strong> Cycle length is computed on local calendar dates. Timestamps plus a timezone offset is how you get an off-by-one around daylight saving time.</li>
<li><strong>A gap is a gap.</strong> If you skip a month, we don't invent the missing period to keep the series tidy. The estimate gets less certain instead.</li>
</ul>
<h2>The arithmetic is deliberately boring</h2>
<p>The prediction is an average with a spread, not a single day. Take the recent cycle lengths, compute the mean, look at how far apart they sit, and project the next start as a range.</p>
<p>When the spread is wide, the range gets wide. That's the honest version of the same calculation most apps run. The difference is whether the app shows you the width or hides it behind one confident-looking date.</p>
<p>Confidence follows the same idea. Recent, consistent, complete records raise it. Fewer cycles, a wider spread, or unusual intervals lower it. An unusually short or long cycle stays in the history as a recorded fact and lowers confidence. We don't delete the records that make the estimate look worse.</p>
<h2>What happens when the data is thin</h2>
<p>With one recorded cycle there's nothing to average, so the app says the data isn't enough instead of guessing. Two cycles already give a range you can use, with low confidence attached.</p>
<p>If you've never logged anything, the setup screen asks for one date and optionally an average cycle length. Nothing is inferred from an empty database.</p>
<h2>Why the date is an input, not a clock</h2>
<p>The prediction function takes the date you're looking at as an argument. It doesn't read the system clock inside the calculation.</p>
<p>So the same records and the same date always produce the same range: on your phone, on a new phone after an export, or a year later when you scroll back to check what the app told you in March. A prediction that changes depending on when you open the app can't be checked later, and a period estimate you can't check isn't worth much.</p>
<h2>The short version</h2>
<p>Six recent cycles, complete records only, local calendar days, an average with a spread, a confidence level that moves with the data, and no silent deletion of the awkward months.</p>
<p>Mori is a free period tracker for Android that keeps all of this on the device. No account, and nothing uploaded unless you turn sync on. You can see the ranges it prints at <a href="https://www.moricycle.com/">moricycle.com</a>.</p>
<p><em>These are estimates from your own history. Not a medical measurement, and not contraception.</em></p>
]]></content:encoded></item><item><title><![CDATA[Why my period tracker counts days, not seconds]]></title><description><![CDATA[A while ago I looked at how health apps store "the period started today" and felt a small chill. Most of them store a timestamp: 2026-11-01T22:15:00Z…]]></description><link>https://alfredchaos.hashnode.dev/why-my-period-tracker-counts-days-not-seconds</link><guid isPermaLink="true">https://alfredchaos.hashnode.dev/why-my-period-tracker-counts-days-not-seconds</guid><dc:creator><![CDATA[Alfred Chaos]]></dc:creator><pubDate>Sun, 01 Nov 2026 00:21:44 GMT</pubDate><content:encoded><![CDATA[<p>A while ago I looked at how health apps store "the period started today" and felt a small chill. Most of them store a timestamp: 2026-11-01T22:15:00Z. Seconds since epoch. Precise, sortable, and quietly wrong for this job.</p>
<p>Here's the failure mode. You record your period on the 1st, in Tokyo. A week later you fly to Los Angeles and open the app. If "cycle day" is computed from timestamps, the app compares your current local time against a UTC instant. Cross enough timezones and the day count can slip by one. Your cycle day says 9 when your body says 8.</p>
<p>Daylight saving does the same thing twice a year. A spring-forward day is 23 hours long. "28 days" in epoch seconds is exactly 28 x 24h, but 28 calendar days across a DST switch isn't. The error is small - minutes - until you floor() it into an integer day count, and then it's a whole day off.</p>
<p>When you're predicting a window that's already expressed in days, an off-by-one is not a rounding error. It's the difference between "expected today" and "expected tomorrow". Users don't read that as floating point. They read it as "this app doesn't know what it's doing".</p>
<h2>What I did instead</h2>
<p>The app I'm building, Mori (<a href="https://www.moricycle.com/">https://www.moricycle.com/</a>), stores cycle records as local dates: 2026-11-01. No time, no timezone, no UTC conversion anywhere in the prediction code.</p>
<p>Every cycle boundary, every "day 14 of your cycle", every next-period estimate is plain calendar-day arithmetic. A 28-day cycle is 28 calendar days. If that crosses February on a leap year, or the end of December, the date library handles it the way a person would.</p>
<p>One rule made this stick: prediction functions take asOfDate as an explicit parameter, and they are not allowed to read the system clock inside. Same records, same date, same output - in Tokyo, in LA, in a test runner at 3 a.m.</p>
<p>That last part matters more than it sounds. When "now" is a parameter instead of a global, the prediction becomes deterministic. You can test "what does the app show on the 29th" without faking the clock. Timezone-dependent bugs stop being a category.</p>
<h2>What this doesn't fix</h2>
<p>Travel still changes your lived experience. If you fly across the pacific, your period doesn't move - but the day you experience as "the 8th" might be the 9th back home. Date-only storage doesn't try to be clever here. It records what you logged, on the day you logged it, and predicts from those facts. That's the honest version.</p>
<p>If you're building anything with a daily rhythm - habits, medication logs, cycles - the lesson is the same. The user thinks in days. Store days.</p>
]]></content:encoded></item><item><title><![CDATA[We couldn't call it "end-to-end encrypted," so we wrote down exactly what it is]]></title><description><![CDATA[Every app claims end-to-end encryption. Ours can't — so we wrote down exactly what the server can and cannot read.]]></description><link>https://alfredchaos.hashnode.dev/we-couldn-t-call-it-end-to-end-encrypted-so-we-wrote-down-exactly-what-it-is</link><guid isPermaLink="true">https://alfredchaos.hashnode.dev/we-couldn-t-call-it-end-to-end-encrypted-so-we-wrote-down-exactly-what-it-is</guid><dc:creator><![CDATA[Alfred Chaos]]></dc:creator><pubDate>Sat, 24 Oct 2026 23:57:52 GMT</pubDate><content:encoded><![CDATA[<p>Every period app I've ever read a privacy policy for uses the same vocabulary. "End-to-end encrypted." "Zero knowledge." "We can't see your data." The words all mean roughly "trust us, it's safe," and almost none of them survive a technical question.</p>
<p>When we added optional cloud sync to Mori — a period tracker whose entire pitch is that records never leave your phone unless you ask — we had to decide what our own words would be. It turned out the honest sentence was longer and uglier than the marketing one, and that's exactly why we kept it.</p>
<h2>The actual architecture</h2>
<p>The sync flow, with the parts vendors usually blur:</p>
<ol>
<li>On-device SQLite is the source of truth. The server never sees a plaintext row.</li>
<li>Each account gets a DEK (data encryption key) generated on the device.</li>
<li>Before upload, the whole snapshot is encrypted with that DEK on the device.</li>
<li>The server stores: your account record, sessions, password-reset tokens, the wrapped DEK, and the ciphertext snapshot.</li>
</ol>
<p>The DEK is <em>wrapped</em> — encrypted with an application master key that lives in our deployment secrets — so it's not sitting in the database readable by anyone who gets a dump. But our server can unwrap it during a legitimate account recovery flow. That's the difference most privacy copy quietly steps over.</p>
<h2>What that makes us, technically</h2>
<ul>
<li><strong>Client-side encrypted</strong>: yes. The server stores ciphertext it cannot casually index or query.</li>
<li><strong>End-to-end encrypted</strong>: no. The server is, by design, a party that can recover the key — because the point of paying $3.99 for sync is that a new phone can restore your records without you having kept a recovery phrase.</li>
<li><strong>Zero-knowledge</strong>: no. Same reason. "Zero-knowledge" has a meaning — the service provably cannot access content — and a recovery-capable DEK-wrapping scheme doesn't meet it.</li>
</ul>
<p>If we had marketed it as E2EE, nobody could have called us a liar on the product page, because the ciphertext really does never travel as plaintext. The lie is in the claim's implication: that even a compromised server or a compelled operator couldn't read your records. Ours could, in the narrow path we built for account recovery.</p>
<h2>The cost of honest wording</h2>
<p>Honesty here has a real price. "Not end-to-end" sounds like a bug to users who've been trained on marketing copy. Side by side in a comparison table, the app claiming E2EE looks safer than the one admitting it isn't — even when the claim is technically empty.</p>
<p>We wrote the caveat into the pricing page, the privacy policy, and the sync docs. Something like:</p>
<blockquote>
<p>encrypted client-side (not end-to-end, not zero-knowledge — the server holds a wrapped recovery key so your account can be restored)</p>
</blockquote>
<p>In the spirit of this article: one spot still says the old, too-strong version — a line in our <code>llms.txt</code> claiming "servers cannot read them." We caught it in a routine review; it gets fixed the same way everything else here did — by writing down what's actually true.</p>
<p>It's clunky. It scans badly. And it means that when the day comes that we ship a genuinely zero-knowledge path — recovery codes instead of server-held keys — we'll have earned the right to upgrade the claim instead of walking it back.</p>
<h2>Why this matters beyond one app</h2>
<p>Period data is subpoena-sensitive in a growing number of jurisdictions. When an app's privacy posture is wrong by a marketing adjective, the people holding the risk are the users, not the copywriters. The cheapest defense anyone can offer is boring: store less, encrypt before it moves, and write down exactly where the key lives.</p>
<p>If your app's privacy page doesn't tell you where the decryption key is, ask. The answer is always in the architecture — it's just usually not in the copy.</p>
<hr />
<p><em>Mori is a free, no-account, offline-first period tracker for Android (signed APK, not on Play Store yet). Optional sync is a $3.99 one-time purchase, documented honestly — including the part we'd rather not admit — on <a href="https://www.moricycle.com/">its site</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[Everything we deleted to make a period tracker offline-first]]></title><description><![CDATA[Building a no-account period tracker meant deleting the auth server, the feed, and the fuzzy math. Here's what survived.]]></description><link>https://alfredchaos.hashnode.dev/everything-we-deleted-to-make-a-period-tracker-offline-first</link><guid isPermaLink="true">https://alfredchaos.hashnode.dev/everything-we-deleted-to-make-a-period-tracker-offline-first</guid><category><![CDATA[privacy]]></category><category><![CDATA[Android]]></category><category><![CDATA[self-hosted]]></category><dc:creator><![CDATA[Alfred Chaos]]></dc:creator><pubDate>Fri, 16 Oct 2026 01:05:57 GMT</pubDate><content:encoded><![CDATA[<p>Building Mori — a period tracker with no account and no required backend — turned out to be mostly a deletion exercise. Every "standard" feature got interrogated, and most didn't survive. A list of what we cut and what it took to cut it:</p>
<p><strong>The account system.</strong> No email, no password, no session tokens, no OAuth. That single deletion removed the auth server, the password-reset flow, the breach surface, and roughly half the privacy policy. The catch: without a user table you can't do lazy things like "store settings server-side," so every preference has to live in on-device SQLite and survive reinstalls poorly — a trade we accepted for the promise that records never leave the phone by default.</p>
<p><strong>The server database.</strong> There's genuinely nothing to leak. Cycle records live in the device's local store, and the prediction algorithm reads that store directly. Sync exists, but it's optional and the snapshot is encrypted with a device-side key before upload, so even enabled, the server sees ciphertext.</p>
<p><strong>The feed.</strong> No content stream, no "insights articles," no notifications trying to re-engage you at 9pm. A tracker is a tool, not a feed — the only notifications are the ones you asked for, and the copy deliberately doesn't reveal anything sensitive on a lock screen.</p>
<p><strong>The paywall logic.</strong> The whole product is a one-time $3.99 if you want the optional sync, and every core feature — logging, calendar, predictions, export, delete-everything — is free and stays free. That meant we couldn't hide retention mechanics behind engagement loops, so the app has to be good on day one or it fails. Scary but honest.</p>
<p><strong>The fuzzy math.</strong> Predictions are deterministic statistics over your logged cycles — ranges, confidence labels, an explicit as-of date — not an ML model and never a single confident-looking date. When there isn't enough history, the app says so instead of guessing quietly.</p>
<p>What survived: local-first SQLite, a calendar you can actually edit, deterministic predictions with honest uncertainty, structured export, and a real delete that has nothing left to forget.</p>
<p>The product is still young and Android-only. If the approach interests you, the site is moricycle.com — the "who it's for" pages explain the tradeoffs better than marketing could.</p>
]]></content:encoded></item><item><title><![CDATA[The period tracker that works in airplane mode]]></title><description><![CDATA[I shipped a small Android app last month and a friend asked a fair question: "does it still work if I turn the internet off?" It does. That was kind of the…]]></description><link>https://alfredchaos.hashnode.dev/the-period-tracker-that-works-in-airplane-mode</link><guid isPermaLink="true">https://alfredchaos.hashnode.dev/the-period-tracker-that-works-in-airplane-mode</guid><dc:creator><![CDATA[Alfred Chaos]]></dc:creator><pubDate>Fri, 09 Oct 2026 00:08:31 GMT</pubDate><content:encoded><![CDATA[<p>I shipped a small Android app last month and a friend asked a fair question: "does it still work if I turn the internet off?" It does. That was kind of the whole point.</p>
<p>The app is called Mori — a period tracker. Almost every option in the store wants an account before you can log a single date. Flo, Clue, most of the others: email first, tracking later. I kept wondering why recording my own cycle on my own phone needed someone else's server at all.</p>
<p>So I built it the boring way:</p>
<ul>
<li><p>Everything writes to a local SQLite file on the device</p>
</li>
<li><p>The whole app works with zero network — install the APK, mark dates, done</p>
</li>
<li><p>Predictions are plain statistics over your own history (cycle length averages, ranges, a confidence label). No model, no remote call, nothing mysterious</p>
</li>
<li><p>There's no signup form anywhere. The app can't leak an email address it never asked for</p>
</li>
</ul>
<p>The prediction part was the interesting constraint. "Smart" period apps usually hide the math, then it turns out the estimate was just an average anyway. I went the other direction: the estimate always shows its basis — "based on your last 4 cycles, average 29 days" — plus a confidence label. If your history is short or irregular, it says so instead of faking precision.</p>
<p>Offline-first also solved the privacy question for free. The strongest privacy feature isn't a policy page, it's that the data never leaves. There is an optional sync tier (one-time $3.99, no subscription) for people who want encrypted backups across devices — snapshots get encrypted on the phone before upload — but the core loop never touches it.</p>
<p>Honest tradeoffs, because nothing is free:</p>
<ul>
<li><p>No account means no web dashboard. If your phone dies and you never enabled sync, the data is gone. I tell users to export the backup file occasionally.</p>
</li>
<li><p>iOS isn't out yet, Android only for now.</p>
</li>
<li><p>Simple statistics can't catch edge cases the way a clinician can. The app is deliberately not medical advice — it's a record-keeper that does arithmetic in the open.</p>
</li>
</ul>
<p>It's at <a href="https://www.moricycle.com">https://www.moricycle.com</a> — free, no account, works in airplane mode. If you've ever uninstalled a health app at the signup screen, this one's for you.</p>
]]></content:encoded></item></channel></rss>