Last night may still have felt messy. There may have been a false start, a feed at 2:00am and a morning that arrived much too early. Then OBubba opens with something unexpectedly hopeful:
> The longest stretch is growing
This is not a congratulations card for one record-breaking night. The current app rebuilds complete nights, finds the longest sleep block inside each one and compares the middle of two groups. It speaks only when the recent median is at least 30 minutes longer.
That distinction matters. Progress in baby sleep is rarely a clean staircase. A family can still have wakes and see one block gradually lengthen. OBubba is trying to make that slow change visible without letting one lucky night—or one awful one—tell the whole story.
Here is exactly what earns the card, why a new family may see an early version, what Celebrate this does and where the encouraging copy goes beyond the data.
The short answer
OBubba has two positive routes to the same dedicated sleep-win card:
| Route | Current rule | |---|---| | Early read | 6–18 valid nights; split into recent and earlier halves; recent median is 30+ minutes longer and at least 2 hours | | Mature read | Up to 14 recent valid nights versus up to 14 earlier valid nights; at least 5 nights in each group; recent median is 30+ minutes longer | | Valid night | Both a bedtime and morning-wake anchor exist | | Statistic | Median longest unbroken sleep block—not mean, total sleep or fewest wakes | | Order | Nights must arrive most-recent first; the Brain supplies up to 28 |
There is also a mature negative route. It waits for a larger 45-minute drop before saying The longest stretch has shortened. Changes between those thresholds remain quiet.
First, OBubba rebuilds each night
The Brain requests up to 28 recent nights from the child’s history and runs each through the app’s canonical night analyser.
That analyser looks for the earliest plausible evening sleep start and the final morning end. It handles sleep arcs that cross midnight, sorts resumed arcs chronologically and removes an overlapping camera-detected arc when a manual sleep record already covers it. It can also recognise a gap between two sleep arcs as awake time.
For this trend, a night counts only when both anchors exist:
- a bedtime; and
- a morning wake.
An open night with no morning end is ignored. A morning wake without a bedtime is ignored. This is a useful guard: the app does not compare a “longest stretch” from a night whose full opportunity for sleep is unknown.
However, ignored nights are removed before the comparison. OBubba is counting valid logged nights, not consecutive calendar nights. If you logged 20 complete nights across six weeks, the older comparison can reach much further back than the phrase “a couple of weeks ago” suggests.
What counts as the longest stretch?
Within a complete night, the analyser turns each recognised waking into an awake interval. A logged wake duration moves the next sleep block’s start to the point when sleep resumed. A 45-minute split wake therefore does not get treated as one instant in the middle of an otherwise enormous stretch.
It then measures every sleep gap:
- bedtime to the first awake interval;
- the end of one awake interval to the start of the next; and
- the final return to sleep through morning wake.
The largest gap becomes that night’s `longestStretchMin`.
This is not necessarily the first stretch. It is not the whole night minus wake time. And it is not a claim that the baby slept independently: rocking, feeding or contact may have helped them return to sleep.
If a completed night contains an open “still awake” pause whose resume was forgotten, treats that sentinel as unlogged rather than swallowing the rest of a confirmed night. That protects the metric from one common timer mistake, but it cannot reconstruct every unlogged wake or settle.
Why the app uses a median
Suppose seven recent longest stretches are:
> 2h 10m · 4h 45m · 4h 50m · 4h 55m · 5h · 5h 05m · 5h 10m
The middle value is 4h 55m. The 2h 10m night still happened, but it does not drag the trend down as strongly as it would drag an average.
For an even number of nights, the app sorts the values and averages the middle two. Four hours and 4h 10m in the centre become a median of 4h 05m.
This design is well suited to infant sleep because travel, illness, teething, an unusual feed or a single chaotic evening can create a real outlier. The median asks, “What does a typical night in this group look like?”
It does not make the detector immune to disruption. Several rough nights can move the middle. It simply stops one night from deciding the result.
The early card: 6 to 18 valid nights
New families do not have to wait a month for any payoff. With 6–18 complete nights, OBubba can surface:
> An early sign: the longest stretch is growing
The valid nights are split into two equal halves. The most recent half is compared with the oldest half. If the count is odd, the single middle night is left out so the groups remain equal.
At six nights, that means three recent versus three earlier. At 17 nights, it means eight recent versus eight earlier, with night nine unused.
The early version has three deliberate protections:
- it requires at least six complete nights;
- the recent median must be 30 minutes longer; and
- the recent median must be at least two hours.
That two-hour floor prevents the app celebrating a shift from, say, a one-hour median to 1h 30m as if sleep were already consolidating into a substantial block.
The early detector is positive-only. If the first few logged nights appear to be shrinking, it says nothing rather than handing a new, exhausted parent a discouraging trend from a tiny sample.
The mature card: at least 19 valid nights
The mature detector takes the first 14 valid nights as “recent,” then the next up to 14 as “prior.” Each group must contain at least five nights.
Because the recent group greedily takes up to 14 first, the mature route cannot fire with only ten complete nights. It needs a minimum of 19 valid nights: 14 recent plus 5 prior. At 28, it compares 14 with 14.
The groups can therefore be uneven:
| Valid nights available | Recent group | Earlier group | |---:|---:|---:| | 18 | Mature detector cannot run; early route may use 9 + 9 | | 19 | 14 | 5 | | 22 | 14 | 8 | | 28 | 14 | 14 |
If the recent median exceeds the earlier median by at least 30 minutes, the title becomes The longest stretch is growing. The body names both rounded durations—for example, “about 5h 10m lately, up from 4h 05m a couple of weeks ago.”
At 19 nights and above, the early detector retires even when the mature detector stays silent. That avoids two systems disagreeing, but it also means a positive early card can disappear once the history crosses 19 valid nights if the mature comparison does not clear its threshold.
Thirty minutes up, 45 minutes down—and silence between
The mature thresholds are intentionally asymmetric:
- +30 minutes or more: growing;
- −45 minutes or less: shortened;
- everything between: no longest-stretch card.
A +29-minute change is silent. A −44-minute change is silent. The app does not round a near miss into a story.
The wider negative threshold makes the system more cautious about turning normal variation into a worrying message. The code does not label this as a statistical confidence interval, though. These are product thresholds, not a medical or scientific test.
The app does not require fewer wakes
This card is about one dimension: the longest block.
A baby could move from three 2-hour blocks to one 4-hour block plus several shorter wakes. The longest stretch improved, but the total night may not feel dramatically better. Conversely, total sleep could rise while the single longest block stays similar.
The detector does not jointly require:
- more total night sleep;
- fewer wakes;
- fewer feeds;
- a later morning;
- easier settling;
- a stable bedtime; or
- improved parent sleep.
Those may be visible elsewhere in OBubba, but they are not gates for this sentence. Read it literally: the typical longest block is longer, not “the whole sleep problem is solved.”

What the dedicated win card shows
Both positive titles are recognised as a special growing-stretch win. Instead of the standard insight card, opens a dark blue and lilac celebration panel with:
- A little sleep win;
- the baby’s first name and “longest stretch is growing”;
- a sleeping-baby-on-a-moon illustration;
- an earlier-versus-lately moon comparison;
- “Based on N nights”;
- Celebrate this; and
- Remind me next week.
The card extracts the earlier and recent durations from the engine’s own sentence, so the comparison stays tied to the measured medians. It also says cycles “may” be starting to link and that OBubba will keep watching—appropriately softer than claiming certainty.
Celebrate this acknowledges the card and closes it. It does not edit sleep records, change predictions, move bedtime or mark a developmental milestone. Remind me next week snoozes the pattern for seven days.
The dismissal identity includes the exact title. That means the early and mature positive cards are separate identities, even though both belong to the same longest-stretch insight kind. A family can acknowledge the early sign and later receive the mature win.
“Sleep cycles are linking” is an interpretation, not an observation
The engine’s explanatory copy links longer unbroken blocks with sleep cycles beginning to connect or mature. That is a plausible way to frame gradual consolidation, but the detector does not observe sleep stages, brain activity or cycle boundaries.
Nor does it test age before showing this trend. The same maths can run for a young infant or an older toddler if enough complete nights exist. The meaning of a longer block—and whether it is developmentally remarkable—will differ.
A more exact translation is:
> “Across your complete logged nights, the recent median of the longest sleep block is at least 30 minutes longer than the earlier median.”
That is still valuable. Parents often cannot feel gradual progress while living inside every wake. The card turns weeks of fragmented memory into a visible direction. It just cannot prove why the direction changed.
It cannot credit bedtime, feeding or a sleep method
The positive card suggests keeping bedtime and wind-down steady. That is a low-pressure way to avoid changing everything after a win, but this detector does not compare consistent versus inconsistent bedtimes.
It also does not establish that the change came from:
- an earlier or later bedtime;
- night weaning;
- a larger evening feed;
- a different settle method;
- solids;
- a nap adjustment;
- a developmental change; or
- the baby “learning” a skill.
OBubba has separate features that can examine some of those relationships. This one does not. Correlation and causation should not be smuggled into a celebration card.
Sparse and selective logging can bend the story
Because incomplete nights are filtered out, the result is only as representative as the complete records.
Imagine a parent tends to finish the timer after calm nights but forgets after brutal ones. The valid-night set will overrepresent easier sleep. Or imagine a partner logs wakes on some nights but not others. The bedtime and morning anchors may be present while the internal awake intervals are incomplete, making the longest block look longer than lived reality.
For the clearest read:
- record bedtime and the final morning wake;
- log night wakes consistently, not only difficult ones;
- end or resume awake pauses when possible;
- correct accidental duplicate sleep arcs; and
- treat missing nights as missing—not as good nights.
You do not need a flawless diary. The median is deliberately forgiving. Consistency matters more than precision to the minute.
Why the card may not appear
OBubba stays quiet when:
- fewer than six complete nights exist;
- 6–18 nights exist but the recent median has gained less than 30 minutes;
- the early recent median is under two hours;
- the early pattern is flat or shrinking;
- 19+ nights exist but the mature groups cannot both reach five values;
- the mature change sits between −44 and +29 minutes;
- the result was already acknowledged; or
- the card is snoozed.
There is another practical reason: the insight feed contains many domains. Higher-urgency health and wellbeing findings can be prioritised above a low-urgency celebration, and a compact preview may not show every eligible card. Open the full What OBubba’s noticed feed to review more.
No card does not mean no progress. It means this specific comparison did not earn this specific sentence.
How to use the win without chasing it
The most useful response is usually boring: notice the change, keep logging and avoid rebuilding the entire routine around one metric.
If the baby seems comfortable and the family’s current approach is sustainable, preserve what is working. If wakes remain difficult, use the longer block as one clue alongside feeding, total sleep, naps, settling and how the parent is coping.
Do not delay a needed feed or ignore a distressed baby to protect a streak. A tracker describes sleep; it does not set a quota that a baby must meet.
Safer sleep does not change when stretches lengthen
A longer block is welcome, but it is not a reason to loosen safer-sleep basics or rely on the app to assess the sleep environment. OBubba reads logs, not the cot.
The Lullaby Trust recommends placing babies on their back for every sleep and keeping the cot clear. NHS safer-sleep guidance likewise describes a separate, clear, flat, firm sleep space and a firm, flat, waterproof mattress (Newcastle Hospitals NHS Foundation Trust).
If a baby is unusually hard to wake, has breathing or colour changes, feeds poorly or seems unwell, check the baby and seek appropriate medical help rather than treating the sleep duration as a reassuring app result.
A better way to read the card
Translate The longest stretch is growing into:
> “The middle value of your baby’s recent longest sleep blocks is at least half an hour above the earlier group. One rough night did not erase that direction.”
That is narrower than “sleep is fixed,” but more meaningful than “last night was good.”
It recognises the kind of progress parents often miss: not perfection, not sleeping through, but a little more uninterrupted rest appearing often enough to become typical.
The bottom line
“The longest stretch is growing” means OBubba found at least 19 complete logged nights and a recent median longest sleep block at least 30 minutes above the earlier median. With 6–18 nights, a positive-only early version can appear when the same gain exists and the recent median is at least two hours.
The detector is thoughtfully cautious. It ignores half-logged nights, uses medians, resists one outlier, keeps a quiet grey zone and asks for a bigger fall before sounding a shortened-stretch heads-up. The dedicated card celebrates without changing the data.
Its limit is equally clear: it measures duration, not sleep stages, cause, parenting method or the quality of the whole night. Valid nights may span longer than the copy implies, and missing wake logs can make a block look too long.
Use the card as evidence of direction—not a verdict. OBubba’s most valuable job here is not to promise that sleep is solved. It is to show an exhausted parent that, underneath the rough nights, something may genuinely be moving.
Ready to try OBubba?
Use OBubba to track feeds, sleep, naps, nappies, growth, milestones and family handovers in one calm baby tracker app.