From 224f8eec074ef3e643dc3176b0599017f924d584 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 21 Oct 2026 22:17:20 +0100 Subject: [PATCH] fix(app): keep attention dismissals in this client's own storage namespace --- app/lib/features/attention/domain/attention_models.dart | 9 +++++---- app/notes/R4-attention.md | 3 ++- .../features/attention/attention_dismissals_test.dart | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/lib/features/attention/domain/attention_models.dart b/app/lib/features/attention/domain/attention_models.dart index 0f89d2cc..6381b86d 100644 --- a/app/lib/features/attention/domain/attention_models.dart +++ b/app/lib/features/attention/domain/attention_models.dart @@ -21,10 +21,11 @@ enum AttentionKind { final String wireName; } -/// The local storage key shared with the browser client: one JSON array of -/// `{runId}:{kind}` strings. A stored dismissal itself never expires; the -/// surface's local-day window is applied when entries are read, not here. -const attentionStorageKey = 'pipelines.web.attention.v1'; +/// This client's own storage key, namespaced like the rest of the app +/// (`pipelines.next.*`). The identity format matches the browser's, but a +/// dismissal set is deliberately not shared with the legacy web app: the two +/// clients must never rewrite each other's local state on a shared origin. +const attentionStorageKey = 'pipelines.next.attention.v1'; /// The run id a summary or pushed frame carries, or null when it is malformed. /// The server ids are positive integers; anything else cannot identify an entry. diff --git a/app/notes/R4-attention.md b/app/notes/R4-attention.md index c8f1cbce..873c95d6 100644 --- a/app/notes/R4-attention.md +++ b/app/notes/R4-attention.md @@ -12,7 +12,8 @@ and success alerts are deliberately outside this slice. - `attention_models.dart` owns the two kinds (`Decision` rank 0, `Failed` rank 1), qualification, ordered entries, labels/detail wording, `{runId}:{kind}` identities, dismissal/snapshot bookkeeping and the JSON string-array - serialisation under `pipelines.web.attention.v1`. + serialisation under this app's own `pipelines.next.attention.v1` (deliberately + not the legacy web key, so neither client rewrites the other's local state). - Only `waiting` and `failed` statuses qualify, after trimming/lowercasing. A waiting run with a session audit/export handoff (`export_pending_sequence > 0`) asks no person and is excluded; a failed run stays failed. `resource_wait` is diff --git a/app/test/features/attention/attention_dismissals_test.dart b/app/test/features/attention/attention_dismissals_test.dart index c2bf2942..3d2addd7 100644 --- a/app/test/features/attention/attention_dismissals_test.dart +++ b/app/test/features/attention/attention_dismissals_test.dart @@ -68,7 +68,8 @@ void main() { group('persistence', () { test('the key is the documented one', () { - expect(attentionStorageKey, 'pipelines.web.attention.v1'); + expect(attentionStorageKey, 'pipelines.next.attention.v1'); + expect(attentionStorageKey, isNot('pipelines.web.attention.v1')); }); test('encoding is one sorted JSON array and round-trips', () {