Target Article: Local-First & Zero-Backend Utility Design: Architecting Browser-Native Tools
Category: design
Review Date: November 29, 2026
Overall Score: 7.8 / 10 (Before) → 9.5 / 10 (After) | Delta: +1.7
Ready for Publication — Applied all 21 Stage 1 recommendations across Reader Mode, Subject Matter Expert, and Technical Architect reviews. Resolved the document vs. Service Worker CSP contradictions (dual CSP headers, CSP-compliant /theme-init.js + /critical.css or SHA-256 hashes, and connect-src ‘none’ security boundaries), hardened URL #v1= decoding with bounded DecompressionStream reading and DOMPurify/AST XSS defense, added Shared-Origin Blast Radius guardrails, refined IndexedDB migrations (oldVersion/onblocked/onversionchange) and browser quota accuracy, improved Focus Timer wall-clock clamping, Habit Tracker DST-safe civil-date math, and Markdown Scratchpad visibilitychange flushing, documented Service Worker update lifecycles and zero-telemetry observability mitigations, added an architecture Mermaid diagram and scannable pitfalls table with concrete portable backup envelope and pure-OSS CRDT graduation path, balanced socio-technical trade-offs, wired contextual repository cross-links, updated primary W3C/WHATWG/WebKit references, and updated immutable header/changelog metadata within strict single-file write scope.Compliant (Invariants 1–3 verified on target article; index and review report sync deferred to Stages 4–5 per A4 single-writer partitioning) with the ThoughtsInWords philosophy and Digital Garden model.8.1 / 10 → 9.4 / 10 (+1.3)7.5 / 10 → 9.5 / 10 (+2.0)7.8 / 10 → 9.6 / 10 (+1.8)| Persona Lens | # | Parameter | Before (0–10) | After (0–10) | Delta | Key Improvement Applied |
|---|---|---|---|---|---|---|
| Reader Mode | 1 | Executive Clarity & Hook (## Summary & ## Key Points) |
8.5 | 9.5 | +1.0 | Aligned the opening ## Summary example list with the three bolded reference architectures (mapping stateless JSON formatters explicitly to the URL-fragment tier) and replaced bare ‘WebKit/Safari ITP’ in ## Key Points with a plain-English gloss (‘Safari’s 7-day inactivity storage eviction’). |
| Reader Mode | 2 | Narrative Flow & Cognitive Load | 8.0 | 9.0 | +1.0 | Resolved the inline <head> script vs. script-src 'self' CSP contradiction across Layer 1 and the CSP section, added a signposting transition at the top of ## Deep Dive, structured the URL-encoding snippet into 3 clearly framed parts, and separated implementation pitfalls from backend boundary criteria. |
| Reader Mode | 3 | Visual Aids & Scannability | 8.0 | 9.5 | +1.5 | Added a third Mermaid flowchart LR diagram visualizing offline boot, multi-tab coordination (BroadcastChannel + navigator.locks + IndexedDB), and the document CSP wall; promoted guardrails into distinct Markdown blockquotes; and converted the dense Anti-Patterns prose wall into a scannable 3-column Pitfalls & Mitigations table plus a separate boundary subsection. |
| Reader Mode | 4 | Accessibility & Actionable Takeaway | 8.0 | 9.5 | +1.5 | Glossed early jargon on first use (‘ITP’, ‘IPC’ under the renamed ‘History Rate-Limit Guardrail’, and ‘lie-fi’), removed the CSP copy-paste footgun by providing both precached external /theme-init.js and SHA-256 hash patterns alongside dual HTML/sw.js headers, and added a concrete 3-Step DevTools Zero-Telemetry Audit recipe and portable JSON backup envelope. |
| Reader Mode | — | Reader Mode Sub-Average | 8.1 | 9.4 | +1.3 | — |
| Subject Expert | 5 | Technical & Domain Accuracy | 7.5 | 9.5 | +2.0 | Resolved CSP self-contradictions with dual Document (connect-src 'none', worker-src 'self', manifest-src 'self') and Service Worker (sw.js: connect-src 'self') headers plus CSP-compliant precached /theme-init.js & /critical.css (or 'sha256-...' hashes); updated openHabitDB() with event.oldVersion, req.onblocked, and db.onversionchange; corrected IndexedDB per-origin total-disk quotas and Private/Incognito behavior. |
| Subject Expert | 6 | Depth of Insight & Edge Cases | 7.0 | 9.5 | +2.5 | Added bounded readStreamBounded() zip-bomb defense, try/catch, schema validation, and DOMPurify/Trusted Types XSS guidance in decodeStateFromHash(); fixed pagehide async IndexedDB teardown trap in favor of visibilitychange (hidden) + optional synchronous crash-rescue buffer; added clamped non-monotonic Date.now() handling, DST-safe civil calendar streak arithmetic + midnight rollover, and shared-origin blast radius analysis. |
| Subject Expert | 7 | Citations, Specifications & Evidence | 8.0 | 9.5 | +1.5 | Corrected BroadcastChannel to WHATWG HTML Web Messaging (web-messaging.html#broadcasting-to-other-browsing-contexts) and added primary citations for WHATWG File System Standard (OPFS), W3C Referrer Policy, and WebKit Blog 14403 (Safari 17+ storage quotas & navigator.storage.persist()), preserving all original references intact. |
| Subject Expert | 8 | Domain Completeness & Currency | 7.5 | 9.5 | +2.0 | Added Service Worker update/cache-invalidation rollout lifecycle (waiting worker prompt + coordinated skipWaiting()/controllerchange + db.onversionchange), persist() silent-denial & local storage-health diagnostics, concrete portable backup envelope (schemaVersion, appId, exportedAt, optional SHA-256 digest, LWW/set-union merge, <a download>/<input type="file"> baseline), optional Web Crypto (crypto.subtle AES-GCM), pure-OSS CRDT graduation path (Yjs/Automerge), and explicit standalone Apache-2.0 scope for dexie. |
| Subject Expert | — | Subject Expert Sub-Average | 7.5 | 9.5 | +2.0 | — |
| Technical Architect | 9 | Architectural Soundness & Trade-Off Rigor | 7.5 | 9.5 | +2.0 | Resolved the inline-script/style vs. CSP 'self' contradiction with dual CSP headers (connect-src 'none' on HTML, connect-src 'self' on sw.js) and clarified connect-src 'none' XSS boundaries; added shared-origin blast-radius guidance, bounded readStreamBounded() decompression-bomb defense, pure-OSS DOMPurify/Trusted Types XSS mitigation, Date.now() wall-clock clamping, Service Worker waiting-state update lifecycle (plus Mermaid diagram), Observability/Supportability NFR row with opt-in scrubbed debug bundle, and Zero-Backend vs. Full Local-First pure-OSS CRDT (Yjs/Automerge) graduation path while maintaining 100% Invariant 1 pure-OSS compliance (including standalone dexie scoping). |
| Technical Architect | 10 | ThoughtsInWords Philosophy Alignment | 7.0 | 9.5 | +2.5 | Resolved the ‘Engineer’s Philosophy’ pitfall by acknowledging legitimate socio-technical drivers for cloud backends (phone-to-laptop continuity, managed recovery, billing, analytics), qualifying maintenance longevity to account for browser storage/privacy policy drift, and foregrounding the human/emotional responsibility shift when everyday users become their own backup operators with empathetic, plain-language export UX. |
| Technical Architect | 11 | Digital Garden Interconnectivity | 8.0 | 9.5 | +1.5 | Wove three contextual inline relative .md links directly into the architecture prose (../frontend/cors-corb-and-orb-browser-isolation.md, ../distributed-systems/anatomy-of-distributed-lock.md, and ../devops/telemetry-capturing-the-usage.md) alongside the three curated ## Related Articles entries, bridging five categories across the Digital Garden. |
| Technical Architect | 12 | Repository Lifecycle & Standards Compliance | 8.5 | 10.0 | +1.5 | Preserved immutable **Date:** November 29, 2026 and verbatim Invariant 1 Scope & Licensing Note, added **Last Updated:** November 29, 2026 and **Review:** report link directly beneath **Date:**, prepended the review entry to ## Changelog in exact bottom-section order (## Related Articles -> ## References -> ## Changelog), and preserved Invariant 4 [NEW]/[UPDATED] badge exclusivity across README.md and articles/README.md. |
| Technical Architect | — | Technical Architect Sub-Average | 7.8 | 9.6 | +1.8 | — |
| Composite | All | Overall Composite Score (0–10) | 7.8 | 9.5 | +1.7 | Verified via multi-persona schema re-evaluation & verify_links.sh |
## Implementation & Release Checklist and NFR Trade-Off Matrix that give readers an immediately usable engineering gate rather than abstract theory.## Key Points (line 20) 310 lines before it is expanded on line 330, ‘IPC’ in ‘History & IPC Guardrail’ (line 221) is never contextualized, and ‘lie-fi’ (line 288) lacks a brief parenthetical gloss.; Subtle narrative and practical contradiction in ## Instant Load Times, Offline Reliability, and Verifiable Zero Telemetry: subsection 1 (line 283) recommends an inline <script> in <head> for pre-paint theme hydration, whereas subsection 3 (line 297) presents script-src 'self' without a 'sha256-...' hash or an explanation of using a tiny cached external boot script, which can trip up readers copying the CSP header.; Inconsistent tier ordering across sections: ## Key Points, the Comparative Matrix, the Decision Flow, and the Reference Summary table order tiers as URL Fragment -> localStorage -> IndexedDB, while ## Deep Dive reverses to localStorage -> IndexedDB -> URL-State without a brief transitional signposting sentence.; Visual aids stop after line 84, leaving the remaining ~300 lines without a diagram; key guardrails (**Discipline Rule:**, **History & IPC Guardrail:**) blend into body prose instead of standing out as callouts, and ## Anti-Patterns & When Zero-Backend Is the Wrong Choice packs five 65-85 word paragraphs into a dense block that conflates implementation bugs with structural backend boundaries.; Minor hook-to-body mismatch: ## Summary opens by naming ‘JSON formatters’ alongside focus timers, habit trackers, and Markdown scratchpads, but JSON formatters are never referenced again in the body.script-src 'self' is fully resolved across Layer 1, Instant Load Times, and the dual CSP header snippet.CompressionStream snippet with labeled sub-sections.ITP, IPC, lie-fi) is contextualized inline, and readers leave with an immediately runnable 3-Step DevTools Zero-Telemetry Audit and concrete backup envelope schema.#fragment, localStorage, and IndexedDB (plus OPFS escape hatch for large binary/WASM workloads).; Strong real-world web platform awareness: correctly highlights RFC 3986 fragment non-transmission, IndexedDB 3.0 { durability: "relaxed" }, Safari history.replaceState rate limits (~100 calls / 30s), and WebKit’s 7-day ITP script-writable storage eviction cap.; Concrete, domain-appropriate reference patterns across three everyday utilities (timestamp-anchored timers, [habitId, localDate] event-sourced IndexedDB check-ins, and #v1= compressed scratchpad sharing).; Clean adherence to Invariant 1 (Pure Open-Source Systems Mandate) with verbatim Scope & Licensing Note and OSI-licensed pure open-source library recommendations (idb, Dexie.js core, fflate).; Strong baseline of 10 primary W3C/WHATWG/IETF specifications and foundational local-first literature in ## References.Content-Security-Policy sets script-src 'self'; style-src 'self'; connect-src 'none', which blocks the inline <head> theme script (Line 283) and inline critical styles (Line 316) unless 'sha256-...' hashes are included, and breaks Service Worker cache.addAll()/fetch() precaching if applied to sw.js (which requires connect-src 'self').; Unbounded decompression and untrusted input risk in decodeStateFromHash(): new Response(stream).arrayBuffer() has no upper byte cap (vulnerable to raw-DEFLATE zip bombs crashing the tab), lacks try/catch for malformed/wrapped URLs, and omits HTML sanitization guidance (e.g., DOMPurify or safe AST rendering) for shared Markdown #v1= links to prevent reflected DOM XSS against local IndexedDB state.; Unreliable pagehide async IndexedDB flush: Line 261 relies on pagehide to persist debounced IndexedDB edits on abrupt tab close, but browsers frequently terminate page contexts before async IDB transactions commit during pagehide.; Missing Service Worker update and cache-invalidation lifecycle: recommends a cache-first App Shell without explaining how updates roll out safely (waiting state, user reload prompt, coordinated skipWaiting()/controllerchange, and avoiding stale HTML or chunk/schema version skew).; Reference code (openHabitDB()) omits its own stated production patterns (event.oldVersion cumulative upgrade gating, req.onblocked, and db.onversionchange = () => db.close()), and the Comparative Matrix conflates per-origin total-disk quotas with free-disk percentages while omitting Private/Incognito quota restrictions.; Subtle domain edge cases omitted: Date.now() non-monotonicity under NTP/manual clock jumps in the Focus Timer (unclamped remainingMs), DST 23/25-hour day arithmetic bugs and midnight rollovers in Habit Tracker streak calculation, and silent navigator.storage.persist() denials under browser heuristics.; Citation imprecision and missing primary specs: BroadcastChannel is grouped under webstorage.html instead of web-messaging.html; OPFS (fs.spec.whatwg.org), W3C Referrer Policy (w3.org/TR/referrer-policy/), and WebKit’s 2023 Storage Policy Update (webkit.org/blog/14403/updates-to-storage-policy/ covering Safari 17+ quotas and persist()) are missing from ## References.; Portable export contract under-specified: recommends merge-on-import JSON exports without detailing the backup envelope (schemaVersion, appId, exportedAt, optional crypto.subtle checksum, conflict-resolution semantics) or noting universal <a download>/<input type="file"> portability vs Chromium-only showSaveFilePicker.connect-src 'none') from Service Worker asset precaching (sw.js with connect-src 'self'), while reconciling FOUC-free pre-paint boot with strict script-src 'self'; style-src 'self' via precached external boot assets or SHA-256 hashes (S-01).decodeStateFromHash() now enforces an explicit MAX_DECOMPRESSED_BYTES cap via readStreamBounded() (stream.getReader() + reader.cancel()), wraps decode/parse in try/catch, supports schema validation, and documents DOMPurify (Apache-2.0/MPL-2.0) + Trusted Types XSS defense and the security limits of connect-src 'none' (S-02).visibilitychange (hidden) as the primary async IndexedDB flush hook—avoiding unreliable pagehide async IDB commits—with an optional small synchronous sessionStorage/localStorage rescue buffer on pagehide (S-03).waiting workers via a non-intrusive reload prompt (skipWaiting() + controllerchange), and coordinates tab reloads with db.onversionchange (S-04).openHabitDB() now demonstrates cumulative event.oldVersion upgrade gating, req.onblocked, and db.onversionchange = () => db.close(), and the Comparative Matrix accurately states Chromium/Safari 17+ (60% total disk) and Firefox (10% total disk / 10 GiB per group) quotas plus ephemeral Private/Incognito limits (S-05).remainingMs against non-monotonic Date.now() clock jumps and contrasts performance.now(); Habit Tracker mandates civil-date calendar arithmetic across 23/25-hour DST transitions and midnight rollover checks (S-06).BroadcastChannel to WHATWG Web Messaging and include primary citations for OPFS (fs.spec.whatwg.org), W3C Referrer Policy, and WebKit’s 2023 Storage Policy Updates (webkit.org/blog/14403) while preserving all original references (S-07).navigator.storage.persist() silent-denial heuristics, local storage-health & scrubbed debug diagnostics, a concrete self-describing JSON backup envelope with merge semantics and universal <a download>/<input type="file"> baseline, optional Web Crypto (crypto.subtle AES-GCM), and pure-OSS compliance across all newly added references (DOMPurify, Yjs, Automerge, standalone dexie) (S-08).Scope & Licensing Note is present, all APIs are open web standards, and all libraries (idb, Dexie.js, fflate) carry OSI-approved licenses with zero vendor-locked or open-core tool recommendations.; Clean, practical three-tier browser persistence architecture (#fragment, localStorage, IndexedDB, plus OPFS escape hatch) backed by a clear decision flowchart, comparative matrix, and three cohesive reference utility patterns.; Honest handling of browser storage realities—specifically Safari/WebKit 7-day ITP eviction, navigator.storage.persist(), IndexedDB durability: "relaxed", BroadcastChannel + Web Locks + db.onversionchange, and history.replaceState rate limits.; Impeccable baseline repository lifecycle hygiene: lowercase kebab-case.md path, immutable **Date:**, exact bottom section order (## Related Articles, ## References, ## Changelog), 10 authoritative primary spec citations, and 3 valid multi-category cross-links.> **Scope & Licensing Note:** This article strictly covers pure open-source systems. Premium, proprietary/vendor-locked, and community-edition (open-core) systems are currently not included. callout is present at line 5. All runtime primitives cited are open W3C/WHATWG/IETF web standards (localStorage, IndexedDB, OPFS, Compression Streams API, Service Workers, BroadcastChannel, Web Locks API, StorageManager API, CSP Level 3, RFC 3986). All third-party libraries mentioned are pure OSI-licensed open-source packages: idb (ISC), Dexie.js (Apache-2.0), and fflate (MIT). WebKit/Safari ITP is discussed purely as a browser platform storage-eviction constraint rather than a recommended vendor system. No proprietary, commercial-only, or open-core (‘Community Edition’) tools appear in prose, tables, code, or diagrams.kebab-case.md path in articles/design/, verbatim Invariant 1 Scope & Licensing Note, immutable **Date:** November 29, 2026, exact bottom section ordering (## Related Articles -> ## References -> ## Changelog), and 1-to-1 [NEW] index parity across README.md and articles/README.md. Three valid cross-category related links exist (including bidirectional linkage with file-over-app-manifesto.md), though body prose lacks inline cross-links to sibling notes on browser isolation, telemetry, and physical clocks, and **Review:** / **Last Updated:** metadata will be added during revision (while respecting Invariant 4 [NEW]/[UPDATED] badge exclusivity)./theme-init.js + /critical.css (or explicit 'sha256-...' hashes) align cleanly with dual CSP headers (index.html with connect-src 'none', worker-src 'self', manifest-src 'self'; sw.js with connect-src 'self'), with explicit documentation of connect-src 'none' XSS/navigation boundaries.readStreamBounded() streaming decompression-bomb guard (256 KiB ceiling) with schema validation, pure-OSS DOMPurify + Trusted Types Markdown sanitization, and clamped Date.now() wall-clock reconciliation against non-monotonic jumps.waiting-worker reload prompts coordinated via controllerchange and db.onversionchange, visualized in a new Mermaid architecture diagram, and added an Observability & Supportability NFR row mitigated via an opt-in ‘Copy Scrubbed Debug Info’ diagnostic bundle.Yjs, Automerge, both MIT) plus optional self-hostable E2EE sync relay or WebRTC..md links (3 contextual inline prose links + 3 curated ## Related Articles links) spanning design/, philosophy/, frontend/, distributed-systems/, and devops/.dexie), immutable **Date:**, **Last Updated:**, **Review:** link, bottom section ordering, ## Changelog update, and [NEW] badge exclusivity intact.| ID | Lens | Priority | Recommendation | Status | Article Section Updated |
|---|---|---|---|---|---|
A-01 |
Technical Architect | High | Resolve the internal CSP contradiction between line 283 (inline <head> theme script), line 316 (inline critical styles), and line 297 (script-src 'self'; style-src 'self'). Either use tiny external same-origin precached /boot.js and /critical.css assets (strictly compatible with 'self') or explicitly document 'sha256-<hash>' entries in the CSP header. Additionally, clarify the security boundary of connect-src 'none': explain that while it blocks XHR/fetch/sendBeacon/WebSockets, it does not prevent DOM XSS from corrupting/wiping local IndexedDB/localStorage or leaking data via navigation redirects if untrusted input is rendered unsanitized. |
Applied | ## Instant Load Times, Offline Reliability, and Verifiable Zero Telemetry & ## Architectural Trade-Offs and NFR Matrix |
A-02 |
Technical Architect | High | Add explicit client-side blast-radius and threat-model guardrails across storage and reference architectures: (1) Shared-Origin Blast Radius—explain that hosting multiple utilities under the same origin shares the 5 MiB localStorage ceiling, IndexedDB quota, Service Worker scope risk, and XSS blast radius, recommending dedicated subdomains/origins or strict path scoping; (2) URL #v1= Decompression Bomb & XSS Defense—bound DecompressionStream output incrementally (e.g., abort above 256 KB–1 MB), validate decoded JSON schemas before import, and sanitize rendered Markdown with a pure-OSS sanitizer (e.g., DOMPurify, Apache-2.0/MPL-2.0) or Trusted Types; and (3) Focus Timer Wall-Clock Trade-Off—note that Date.now() survives reload/sleep but is non-monotonic under NTP steps or manual clock changes (unlike performance.now()), and how to clamp negative/anomalous deltas gracefully. |
Applied | ## Deep Dive: Engineering Each Storage Layer Safely, ## Three Reference Utility Architectures & ## Anti-Patterns & When Zero-Backend Is the Wrong Choice |
A-03 |
Technical Architect | High | Add Service Worker Update Lifecycle & ‘Zombie Cache’ Prevention plus an Observability / Supportability NFR row: distinguish Cache-First for immutable content-hashed assets from Network-First / Stale-While-Revalidate (or explicit ‘Update Available’ reload prompt) for the HTML shell; coordinate skipWaiting()/controllerchange with db.onversionchange so open tabs do not split across incompatible IndexedDB schema versions; and document the zero-telemetry observability blind spot (zero crash/eviction/migration telemetry) mitigated via an opt-in local diagnostic bundle (‘Copy Scrubbed Debug Info’ containing schema version, storage quota estimate, and recent client errors). |
Applied | ## Instant Load Times, Offline Reliability, and Verifiable Zero Telemetry & ## Architectural Trade-Offs and NFR Matrix |
A-05 |
Technical Architect | High | Eliminate the ‘Engineer’s Philosophy’ oversimplification by reframing cloud-first defaults beyond mere ‘architectural inertia’ and qualifying the ‘zero maintenance for years’ claim. Explicitly address socio-technical and human constraints: (1) why teams and builders default to backends (cross-device continuity expected by non-technical users between phone and laptop, sustainable monetization, product analytics, and managed account recovery), (2) browser platform drift (storage partitioning, ITP policy shifts, API deprecations) that still demands periodic stewardship, and (3) the human responsibility shift—making users their own backup operators carries cognitive and emotional risk unless paired with empathetic, non-jargon export/restore UX. | Applied | ## The Backend Tax on Everyday Utilities, ## Anti-Patterns & When Zero-Backend Is the Wrong Choice & ## Conclusion |
R-02 |
Reader Mode | High | Resolve the apparent contradiction between the inline <head> pre-paint theme script (subsection 1) and the script-src 'self' CSP header (subsection 3). Explicitly explain the two CSP-compliant ways to avoid FOUC without 'unsafe-inline': either serve a tiny render-blocking same-origin /boot-theme.js precached by the Service Worker, or include a 'sha256-...' hash in script-src. |
Applied | ## Instant Load Times, Offline Reliability, and Verifiable Zero Telemetry & ### Layer 1: localStorage |
R-04 |
Reader Mode | High | Add a Mermaid sequenceDiagram or flowchart LR in ## Instant Load Times, Offline Reliability, and Verifiable Zero Telemetry illustrating the offline cache-first boot path, multi-tab coordination (BroadcastChannel + Web Locks + IndexedDB), and the CSP network wall (connect-src 'none') so the second half of the article maintains strong visual scannability. |
Applied | ## Instant Load Times, Offline Reliability, and Verifiable Zero Telemetry |
S-01 |
Subject Expert | High | Resolve the CSP contradictions in the example header: (1) explicitly document that the Service Worker script (sw.js) must be served with its own connect-src 'self' policy so cache.addAll() and same-origin fetch() succeed during install, while the document keeps connect-src 'none' (and add worker-src 'self'; manifest-src 'self'); (2) reconcile script-src 'self'; style-src 'self' with the inline <head> theme script and inline critical styles by either adding a 'sha256-...' hash placeholder or moving pre-paint theme hydration to a tiny synchronous same-origin external <script src="/theme-init.js"></script>. |
Applied | Instant Load Times, Offline Reliability, and Verifiable Zero Telemetry (Sections 1 & 3) |
S-02 |
Subject Expert | High | Harden decodeStateFromHash() against decompression bombs and corrupted URLs by reading from stream.getReader() with a strict MAX_DECOMPRESSED_BYTES ceiling (e.g., 256 KB–1 MB) that cancels the stream if exceeded, wrapping decoding and JSON.parse() in try/catch, and adding a security callout warning that decoded #v1= payloads (especially shared Markdown notes) are untrusted input requiring safe AST rendering or pure open-source sanitization (e.g., DOMPurify under Apache-2.0/MPL-2.0) to prevent reflected DOM XSS against local IndexedDB records. |
Applied | Layer 3: URL-State Encoding — Stateless Sharing & Bookmarkable Snapshots |
S-03 |
Subject Expert | High | Refine the Markdown Scratchpad flush strategy to note that async IndexedDB transactions initiated inside pagehide are frequently aborted during browser teardown (especially on mobile). Treat visibilitychange (document.visibilityState === "hidden") as the primary async IndexedDB flush hook, and optionally write a small synchronous crash-rescue buffer to localStorage/sessionStorage on pagehide that reconciles into IndexedDB on next boot. |
Applied | 3. Local-First Markdown Scratchpad |
S-04 |
Subject Expert | High | Add a concise Service Worker update and cache-invalidation lifecycle explanation covering how a cache-first App Shell rolls out updates safely without trapping users on stale builds or causing version skew across tabs: distinguish immutable content-hashed assets (cache-first) from navigation/manifest updates, handle the waiting worker state with a user-triggered reload prompt (skipWaiting() + controllerchange), and coordinate reloads with db.onversionchange. |
Applied | 2. Offline Reliability, Update Lifecycle & Multi-Tab Coordination |
A-04 |
Technical Architect | Medium | Clarify the architectural distinction between Zero-Backend (single-device local persistence + manual/stateless handoff) and Full Local-First Software (Ink & Switch’s seven ideals including multi-device sync and collaboration). In Anti-Pattern #5, sketch a concrete pure open-source graduation path—such as layering pure-OSS CRDT libraries (e.g., Yjs under MIT or Automerge under MIT) with an optional self-hostable E2EE sync relay or WebRTC peer transport—when a utility legitimately outgrows single-device zero-backend boundaries. | Applied | ## Anti-Patterns & When Zero-Backend Is the Wrong Choice |
A-06 |
Technical Architect | Medium | Deepen Digital Garden interconnectivity by adding contextual inline cross-links in the article prose to existing repository notes—specifically ../frontend/cors-corb-and-orb-browser-isolation.md (origin-isolation & shared-origin blast radius), ../distributed-systems/anatomy-of-distributed-lock.md (physical wall-clock jumps vs. monotonic/logical coordination and locks), and ../devops/telemetry-capturing-the-usage.md (the deliberate observability trade-off of zero telemetry)—and consider adding a concise 4th cross-link in ## Related Articles (or keeping 3 curated items in ## Related Articles per Invariant 3 while wiring the inline links and updating articles/README.md reading trails / calm-technology-ambient-progress-indicators.md backlink during index sync). |
Applied | ## Deep Dive: Engineering Each Storage Layer Safely, ## Three Reference Utility Architectures, ## Architectural Trade-Offs and NFR Matrix & ## Related Articles |
A-07 |
Technical Architect | Medium | During Stage 2/3 lifecycle completion, keep **Date:** November 29, 2026 immutable, insert **Last Updated:** Month Day, Year directly beneath **Date:**, insert **Review:** [Expert & Architecture Review Report](/ThoughtsInWords/reviews/design/local-first-zero-backend-utility-design-review.html) directly beneath the date headers, prepend the revision summary to ## Changelog, record a Reviewed & Updated entry in articles/CHANGELOG.md, and strictly enforce Invariant 4 [NEW]/[UPDATED] badge exclusivity (do NOT add [UPDATED] to README.md or articles/README.md while this article holds [NEW]). |
Applied | Header Metadata (**Date:**, **Last Updated:**, **Review:**) & ## Changelog |
R-01 |
Reader Mode | Medium | Tighten ## Key Points bullets by trimming early API jargon (replace bare ‘WebKit/Safari ITP’ with a plain-English gloss such as ‘Safari’s 7-day inactivity storage eviction’) and align the opening ## Summary example list with the three reference utilities built in the article (or briefly note how stateless formatters map cleanly to the URL-fragment tier). |
Applied | ## Summary & ## Key Points |
R-03 |
Reader Mode | Medium | Add a one-sentence signposting transition at the top of ## Deep Dive: Engineering Each Storage Layer Safely explaining the progression from synchronous boot (localStorage) to transactional persistence (IndexedDB) to stateless sharing (URL-State), and add a brief 1-line framing before the 40-line CompressionStream code block separating the base64url helpers from the core encode/decode pipeline to reduce cognitive load. |
Applied | ## Deep Dive: Engineering Each Storage Layer Safely |
R-05 |
Reader Mode | Medium | Promote **Discipline Rule:** (line 128) and **History & IPC Guardrail:** (line 221) into Markdown blockquote callouts so guardrails pop visually on a scan, and split ## Anti-Patterns & When Zero-Backend Is the Wrong Choice into two clearly separated sub-blocks—Four Implementation Pitfalls (concise scannable bullets or a compact Pitfall/Mitigation table) and When You Actually Need a Backend—to break up the dense prose wall. |
Applied | ## Deep Dive: Engineering Each Storage Layer Safely & ## Anti-Patterns & When Zero-Backend Is the Wrong Choice |
R-06 |
Reader Mode | Medium | Contextualize technical jargon on first use: expand or gloss ‘ITP’ in ## Key Points, clarify or rename ‘IPC’ in History & IPC Guardrail (e.g., ‘History Rate-Limit Guardrail’ or briefly note browser inter-process messaging), and add a 3-5 word parenthetical gloss for 'lie-fi' (e.g., ‘connected networks that silently hang requests’). Optionally add a crisp 3-step DevTools verification mini-recipe under Verifiable Zero Telemetry so readers can audit zero outbound requests immediately. |
Applied | ## Key Points, ## Deep Dive: Engineering Each Storage Layer Safely, & ## Instant Load Times, Offline Reliability, and Verifiable Zero Telemetry |
S-05 |
Subject Expert | Medium | Update openHabitDB() to demonstrate its own stated best practices: pass (event) to onupgradeneeded with if (event.oldVersion < 1) cumulative migration gating, handle req.onblocked, and attach db.onversionchange = () => db.close() in onsuccess. Also correct the Comparative Matrix IndexedDB capacity cell to distinguish per-origin total-disk quotas (e.g., up to 60% of total disk in Chromium and Safari 17+, 10% of total disk / 10 GiB per group in Firefox) from reduced ephemeral quotas in Private/Incognito mode. |
Applied | Comparative Matrix & Layer 2: IndexedDB — The Transactional Local Database |
S-06 |
Subject Expert | Medium | Add concrete clock and calendar edge cases to the Reference Architectures: (1) in the Focus Timer, clamp remainingMs with Math.min(state.durationMs, Math.max(0, state.endsAt - Date.now())) and note Date.now() non-monotonicity under NTP/manual clock adjustments versus session-scoped performance.now(); (2) in the Habit Tracker, note that streak math must use calendar civil-date stepping (never subtracting 86_400_000 ms, which fails across 23/25-hour DST transitions) and handle midnight rollover while a tab remains open. |
Applied | Three Reference Utility Architectures (1. Focus Timer & 2. Habit Tracker) |
S-07 |
Subject Expert | Medium | Fix the BroadcastChannel reference by linking it to the WHATWG HTML Web Messaging section (https://html.spec.whatwg.org/multipage/web-messaging.html#broadcasting-to-other-browsing-contexts) instead of webstorage.html, and add primary citations for OPFS (https://fs.spec.whatwg.org/), W3C Referrer Policy (https://www.w3.org/TR/referrer-policy/), and WebKit’s 2023 Storage Policy Updates (https://webkit.org/blog/14403/updates-to-storage-policy/ covering Safari 17+ quotas and navigator.storage.persist()). |
Applied | References |
S-08 |
Subject Expert | Medium | Round out operational lifecycle completeness by (1) noting that navigator.storage.persist() often returns false silently until browser engagement/PWA heuristics are met and recommending local storage-health diagnostics (estimate() headroom, persisted flag, last backup age); (2) specifying a concrete portable backup envelope (schemaVersion, appId, exportedAt, optional crypto.subtle SHA-256 digest, and merge semantics such as LWW or set-union) with <a download>/<input type="file"> as the universal cross-browser baseline vs Chromium-only showSaveFilePicker; and (3) briefly noting native Web Crypto (crypto.subtle AES-GCM) as an optional zero-backend primitive for passphrase-encrypted exports or shared links. Also add a brief clarification in Layer 2 that only the standalone Apache-2.0 dexie library (not commercial sync add-ons) is in scope. |
Applied | Layer 2: IndexedDB & Anti-Patterns & When Zero-Backend Is the Wrong Choice |