docs(meditate): ADR 0038, D14, the dream journal the developer asked for

The developer's request of 3 Nov 2026: a dream journal, sealed and
synced as the sittings, with Today's morning card and its switch in
Settings. What an entry holds beyond the request, its own `dream`
table, the fourth tab between Explore and Profile and why, the
Journal's list, search and filters, the editor and Profile's two
figures are the agent's recommendations, to be confirmed. The `dreams`
migration's SQL is explained under Migrations; it is step 5, the
release moving to step 6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-03 14:18:59 +01:00
commit 83edaeabe0
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -3,7 +3,8 @@
- **Status:** proposed 3 Nov 2026 by the agent, the developer having asked to "continue as
far as possible without my interjection"; every decision below is the agent's
recommendation unless it says the developer's, and is put to the developer with the
first version. Built the same day: steps 1 to 4.
first version. Built the same day: steps 1 to 4; the dream journal (D14, the
developer's request of the same day) as step 5.
- **Builds on:** ADR 0033 (Todo's shell, which Meditate copies as Train copied Todo's,
ADR 0030, D12); ADR 0030, D7, D14, D15 and D61 (sealed rows, the person's key, What's
new); ADR 0031, D5 and D7 (Meditate's icon: Lucide's `sprout`, cobalt through pacific
@ -45,7 +46,8 @@ names and pictures are its own). Everything below is Halkyon's own.
Meditate's icon on top from medium on), halkyon_app's first start, sign-in and
account, What's new after an update, About, English and German. Copied from Todo's
and renamed, as Train's was (ADR 0030, D12), Todo's own features left out.
- **D2 Three tabs: Today, Explore, Profile**, as 7Mind has three, Today opening.
- **D2 Three tabs: Today, Explore, Profile**, as 7Mind has three, Today opening (four
since D14, the Journal between Explore and Profile).
*Today* (not *For you*: nothing is chosen for the person by anyone) starts a sitting at
once, shows the week and the streak, the favourite practices and the ones done last.
*Explore* holds every practice, by kind and by what it is for, with search. *Profile* is
@ -125,6 +127,50 @@ names and pictures are its own). Everything below is Halkyon's own.
8290 (Learn's and Todo's are 8080 to 8090, Train's 8180 to 8190), so Meditate's server
runs beside the others as a member of Learn's register.
## The dream journal (3 Nov 2026, the developer's request)
- **D14 A dream journal**, asked for by the developer on 3 Nov 2026 with what an entry
holds, that it is sealed and synced as the sittings, the Journal's list, search and
filters, Today's morning card and its switch in Settings, the empty state's word on
sealing, quick writing, and optional figures in Profile. What follows beyond that is
the agent's recommendation, to be confirmed:
- **An entry** (`Dream`): the night, named by the morning after it (a date at
midnight UTC, as every day the app counts) and by default today's date at any hour,
so "last night" even when written at 1 o'clock; a title, empty where none; the text;
the marks lucid, nightmare and recurring, as a set; clarity 1 to 5 or none; the mood
on waking from five (glad, calm, puzzled, sad, uneasy: few enough to choose half
awake, a mixed or neutral one left out as *none* says it); free labels (people,
places, themes, one list rather than kinds of label, each once whatever its case,
those used before offered by how often); and when it was first written, kept through
edits. Marks and moods by name in the payload (schema 1), so never renamed; a value a
version doesn't know reads as none.
- **Its own table, `dream`**, a row a dream, sealed for its table and row as the
sittings (D7), rather than rows in `sitting` or one row of all dreams: a dream is
changed and deleted on its own, and a row each keeps the sync's merges to the one
changed.
- **Where it lives: a fourth tab, Journal**, between Explore and Profile (Today,
Explore, Journal, Profile), as the developer suggested: a dream is written every
morning and searched later, a list of its own like Explore's, which under Profile
would be two taps deep and crowd the person's figures; four destinations still fit
the bar on a phone. Its icon is Lucide's `moon-star`. A dream opens over the tabs,
as a sitting and Settings do, for the whole screen while writing.
- **The Journal**: the newest month first, each month a card with its dreams the
newest night first; a search over title, text and labels as Explore's (every word,
without case or accents); the marks as filter chips, a dream shown where it carries
every one chosen; *+* above the bar as Train's buttons. Empty, it says what it is for
and that every entry is sealed on the device before it syncs.
- **Writing**: the text field first, focused, the rest (night, title, marks, clarity,
mood, labels) folded below it for a new dream and unfolded for a kept one; Save
once there is text. A kept dream opens to read, with Edit and Delete (asked first);
leaving a dream written but not saved asks first.
- **Today's card** from 4 to 12 o'clock while last night has no dream, below the
greeting, leading to a new dream; switched off in Settings' *Journal* card
(`dreamPrompt`, on at first, in the sealed settings: schema 1 stays, as a reader
that doesn't know it reads it as at first).
- **Profile's Practice** shows, once the journal holds a dream, a small *Dream
journal* card: the dreams of this month and the lucid ones of all.
- Not done: reminders to write (D12), dreams linked to sittings, figures over time.
## Steps
1. **The shell** (3 Nov): Todo's copied and renamed, its features left out, the three tabs
@ -134,7 +180,9 @@ names and pictures are its own). Everything below is Halkyon's own.
3. **The practices and the sitting** (3 Nov): the catalogue (D4), the bells (D5), the
sitting's screen (D6), Explore (D10).
4. **Today and Profile** (3 Nov): D8, D9.
5. **Released and deployed** (later, as Todo's step 5): `apps/meditate/release.dart`, a key
5. **The dream journal** (3 Nov): D14, the `dream` table and its migration, the Journal
tab, a dream's screen, Today's card, Settings' *Journal*, Profile's figures.
6. **Released and deployed** (later, as Todo's step 5): `apps/meditate/release.dart`, a key
of its own, the F-Droid listing, a snap, `deploy/compose.meditate.yaml` at
meditate.halkyon.eu (its `.env` values the developer has set already, 2 Nov), its
database and role, `redeploy.sh` and `backup.sh` taking it in.
@ -154,6 +202,12 @@ names and pictures are its own). Everything below is Halkyon's own.
`offline_sync_spaces` deleting with the space (`ON DELETE CASCADE`); then the version
rows of every module (`INSERT … ON CONFLICT DO UPDATE` into `serverpod_migrations`).
Purely additive: no row exists to transform.
- `dreams` (D14): the table `dream` as `sitting` is (`CREATE TABLE "dream"`: `id` a UUID
v7 by default, the function defined again with `CREATE OR REPLACE`, unchanged; a
nullable `spaceId`; `keyId`, `payload` not null and `nonce`, the envelope), the index
`dream_space_idx` on `spaceId`, its foreign key to `offline_sync_spaces("id")` with
`ON DELETE CASCADE`, so a person deleted takes their dreams with their space; then the
version rows. A new, empty table: nothing existing changes.
## Later