Tratto
Tratto records what I eat and how my gut behaves, and stops there. It will not rank foods by suspicion, and that refusal is the design.
Where it came from
Section titled “Where it came from”I asked the obvious question in 2020: keep a food and bowel diary for 68 days, then work out which foods were doing the damage. The answer was that the diary could not tell, and the reason was in the data rather than in the arithmetic. Most days were recorded half way, and the foods worth examining had never been eaten often enough or separately enough to be told apart.
That is what Tratto is built on. A diary is worth keeping and worth keeping well, and the moment it names a culprit it is making something up.
What it does
Section titled “What it does”Three taps for a bathroom visit: open, pick the form from seven drawings, save. Meals are typed or dictated in plain language and matched against a closed vocabulary of 142 ingredients in English and Italian, always correctable by hand. One question a day, at night: worst abdominal pain in the last 24 hours.
It also records absence. A bathroom visit is memorable and a breakfast identical to every other breakfast is not, so the app asks about the slots I skipped and takes “nothing” for an answer. An empty morning is then empty rather than unknown, which is the difference between a diary that can be read and one that cannot.
What it shows is coverage, the distribution of forms, how pain has moved, how much the numbers wander on their own, and how far apart two days have to be before they stop resembling each other. It never shows a ranking of foods.
Privacy, integrations, scales, price
Section titled “Privacy, integrations, scales, price”Privacy. No server, no account, no telemetry, and no network request made by the app at all. No iCloud either: App Store rules forbid keeping personal health data there, and syncing is the point where a local app stops being one, so moving the diary between my Mac and my phone is an explicit file. Meal text is matched on the device. The web build is deliberately not hosted on nerln.github.io, because a health diary in browser storage on an origin shared with other projects is readable by any other page on that origin.
Integrations. Export produces a FHIR R4 bundle, three CSVs, the full JSON, and a one-page PDF on Apple platforms; import takes the JSON back. External codings are optional and off by default and a local coding is always present, because stool form has a SNOMED concept and no LOINC code, pain has a LOINC code and needs no SNOMED, and SNOMED is not free in Italy.
Tratto writes to neither Apple Health nor Health Connect. Apple Health has seven gastrointestinal symptom types on a four-level severity enum, so a 0 to 10 pain score projects onto it and never comes back. Health Connect has 42 record types and none of them is a bowel movement, a stool form, a gastrointestinal symptom or a pain score. Neither accepts a custom type.
Scales. Seven levels of stool form with drawings and labels of my own, and no proprietary instrument named anywhere in the interface, because the best known seven-level scale is copyrighted and its ownership is disputed between three organisations. Pain 0 to 10 as the primary outcome, LOINC 72514-3. Meal slots instead of free timestamps. Every export states which scale produced the numbers, and no published clinical index is computed.
Price. Free on all four platforms, with no subscription and no paid tier. On iOS a self-built app has to be reinstalled every seven days without a paid developer account.
Phase two
Section titled “Phase two”Passive observation cannot produce the evidence, so the second phase arranges instead of observing. One ingredient against one comparison ingredient, alternating blocks with a gap between them, order randomised inside each pair, and the plan frozen: hypothesis, outcome, decision rule and block order go into a canonical text whose SHA-256 is stored. Change any of them afterwards and the analysis refuses to run.
Before committing two months, the app shows the number that decides whether the experiment is worth running. With six pairs and a two-sided hypothesis the sign test needs six agreements out of six, so for a food that genuinely affects me in eight pairs out of ten the chance of a significant result is 26 per cent. Below six pairs nothing can reach significance at all.
The control block is there because in a published blinded challenge glucose, the inert control, triggered symptoms in 26 per cent of patients.
Two implementations, one set of numbers
Section titled “Two implementations, one set of numbers”The Apple version is Swift, the Windows and Android versions share a TypeScript core, and the same exact statistics exist twice. The Swift suite writes a file of golden numbers and the TypeScript suite reproduces it digit for digit, Wilcoxon with tied ranks and the 64-bit block shuffle included. CI regenerates the file on macOS and fails if it moved.
The oracle for the exact tests is not scipy. With ties, scipy.stats.wilcoxon(mode="exact") uses the tie-free table and disagrees; the oracle is the enumeration of all 2ⁿ sign assignments.