From 54286e9bf040f22c287378866f46a5c4aa849a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Bene=C5=A1?= Date: Fri, 13 Nov 2026 09:57:58 +0000 Subject: [PATCH] Design: Reports, notify when, the report push, a page as a card; Working-notes: pages, made-up names Co-Authored-By: Claude Fable 5.2 --- Design.md | 40 +++++++++++++++++++++++++++++++++++++++- Working-notes.md | 8 ++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/Design.md b/Design.md index a7a23ad..0a34827 100644 --- a/Design.md +++ b/Design.md @@ -102,6 +102,44 @@ failed. A tap and Open go to the run (on the instance the push came from); Pause the payload offers it (a failure; `ask: pause` after three in a row). A server without the routes answers 404, and the page says scheduling needs a newer server. +## Reports and "notify when" (harness spec 3.8.0) + +From LLeMbas 2.0.0-beta.12 a schedule's run does not answer into a chat: it files a **report** +(the model's `report_write`), or leaves a line in the task's history. The phone's half +(`api/Reports.kt`, `ui/reports/ReportsScreen.kt`, `push/ReportNotice.kt`): + +- **Reports** in the drawer with a count of the unread (asked for when the drawer opens: + `GET /reports?unread=1`). The list (`GET /reports`) is sorted by the app -- unread first, then + newest (`sortedReports`); pull reads it again; a swipe marks a row read (`POST …/read`) or + asks once and deletes it (`DELETE`). A swipe never removes the row by itself. +- **A report** (`report/{id}`, `GET /reports/{id}`) reads as a page: its Markdown through + `RichMarkdown`, the chat's untrusted rules. Opening it marks it read. Share hands over the + title and the text projection (`shareText`). +- **Reply** (`POST …/reply` answers the chat's id; a report that already has a `chat` goes + straight there) opens the ordinary `ChatScreen` on the route `report-chat/{id}` with + `report = `: the bar says *Report: …*, the navigation icon is Back, and leaving goes + back to the report. The server keeps that chat out of the chats list; the app never adds it. +- **Notify when** on the schedule form: `notify` `always` | `when` | `never` and `notify_when` + (the person's words; empty means the default condition). `notifyChoice` reads what an older + server called `matters` as `when`. The form shows and sends them only where the instance has + the reports route (asked once when the form opens): an older server knows other values. +- **A task's runs** show the run's `note` (else the old `preview`) and *Open its report* where + `report` names one; the run's page has the same link, and still *Open its chat*. +- **The push** `kind: report`: the words are in the payload's `notification` (title, body, + importance); the payload's top says only the app's name and "New report". Channel + **Reports** (`reports_filed`; the id `reports` was 0.1's and is deleted at start), + `VISIBILITY_PRIVATE` with a public version of the app's name and "New report" -- nothing from + the account. Open, and Mark read (`setAuthenticationRequired`). `schedule` and + `schedule_failed` from an older instance go through `ScheduledNotice` as before. +- An id that may come as a string or as an object carrying one (a report's `chat`, a run's + `report`) is read either way (`idOf`). + +**A page in an answer is not drawn** (`pages.md`; the owner's decision: no web view in the app). +`splitFences` turns an `html-view` fence -- closed or still being written -- and the server's +`[page: Title]` line into `Segment.Page`, and a `page` step is the same thing: `PageCard` says +*This answer has a page: …* and where to open it. The source is never shown; Copy, Share and +read-aloud take `pageProjection`. The chat's settings offer no HTML switch. + ## Signing in The CLI's device login: discovery at `/.well-known/lembas.json` (the app refuses an instance @@ -155,7 +193,7 @@ UnifiedPush 3: the app registers with the distributor the person chose (ntfy, or giving it the instance's VAPID key, and hands the endpoint and its keys to `/api/v2/push`. The server sends Web Push to it with the code it uses for browsers. One registration per instance. Channels: Replies, Questions and approvals (high importance), Scheduled results, Scheduled -failures (high importance); every one private on the lock screen. An approval's +failures (high importance), Reports; every one private on the lock screen. An approval's notification carries Allow once and Deny, both `setAuthenticationRequired` (Android 12+ asks for the unlock first); "always" and a corrected command need the card. A fifth channel, App updates (low importance), carries only the update check's notice. diff --git a/Working-notes.md b/Working-notes.md index d06734b..ec1e5c9 100644 --- a/Working-notes.md +++ b/Working-notes.md @@ -136,6 +136,14 @@ design change, before a phone. - **A number in a keywords line or a duration is formatted with `Locale.ROOT`**; the phone's locale would write a decimal comma. A number a person reads (`localeNumber`) is the opposite: the phone's format, and `Locale.ROOT` there means the spec's plain format for the tests. +- **A page in an answer is never drawn and never dumped.** No WebView (rule 4); an `html-view` + fence, the server's `[page: Title]` line and a `page` step are all `PageCard`. Anything new + that shows or copies a reply's text goes through `splitFences` / `pageProjection`. +- **Names in fixtures and fakes are made up.** Nothing seen in a screenshot or a message from + the owner -- a machine, a host, a path, a task's name -- goes into code, tests, the changelog + or a commit; `scripts/hygiene.sh` runs before every push (a local hook refuses otherwise). +- **A report's notification shows the report only when unlocked.** The public version is the + app's name and "New report"; `ReportNotificationTest` reads both faces. - **Display follows the harness spec** (`display.md`, 3.7.0): `api/Display.kt` has the title cut, the call states and duration, the end line of a stopped or failed reply, and locale numbers. - **Phone actions drive OsmAnd through `osmand.api://` URIs only.** Its AIDL API's classes are