Skip to content

id(web): wire the IndexedDB store adapter into the production web app — drafts path through the store layer (unblocks #14774 slice 4) #16808

Done

Description

@dezren39

Why

#14774 slice 4 (offline drafts, follow-on of the #13918 service-worker design, record doc/2026-11-25_design_id_service_worker_offline_13918.md §7) is dependency-blocked: per the 2026-11-28 triage recheck on #14774, the IndexedDB store adapter exists only in the browser prototype/test surface (pkgs/id/browser/test/indexeddb_conformance.test.ts, browser_driver.ts) and pkgs/id/web has no production import of it (code search: IndexedDB and drafts in pkgs/id/web → 0 results). No open issue owned that production wiring; this issue is that owner (ready condition 2 on #14774).

Roadmap item 21 in the design record: drafts are written locally and synced by the store layer; the service worker stays a cache.

Scope

  • Production wiring of the IndexedDB store adapter (or its successor) into the web app under pkgs/id/web, behind the same store-layer interface the app already uses.
  • A drafts path: draft writes go through the store layer to IndexedDB; the service worker remains cache-only (no draft logic in the worker).
  • Conformance coverage carried over from the browser prototype tests where applicable.

Acceptance

  • pkgs/id/web imports and uses the IndexedDB-backed store adapter in production code (not only tests/prototype).
  • A draft can be written offline through the store layer and read back; sync hooks through the store layer are in place.
  • The service worker contract from slices 1–3/5 is unchanged (worker stays a cache).
  • Tests for the wiring pass; id: service-worker offline web app — slices 2–5 (follow-on of #13918) #14774 slice 4 can then be claimed against this wiring.

Refs #14774, #13918. Filed by Xaltha lane 0647-L17 (blocker work for #14774 slice 4).

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-29T13:46:06Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "aa5a503c40005914ca3676c21a1da732e7aeb3d7"
    },
    "auth_subject": "xaltha",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Activity

  1. dezren39 commented on Nov 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · claimed — Xaltha lane 0647-L17, 2026-11-29

    Filing lane is implementing the first slice in the same pass (worktree w0647-l17, branch xaltha/16808-idb-web-wiring): production DraftStore in pkgs/id/web over the IndexedDB adapter, draft persisted on failed save, cleared on successful save, synced at editor open only over the version it was written against (conflicts kept, per the #13918 record).

    Not enqueued as a queue packet by this lane: packet enqueue is creator-run machinery, and the issue is already under a live claim with the PR following in this same pass; the standing coverage reconciliation can import it if the slice leaves a remainder.

  2. added 2 commits that reference this issue on Nov 29, 2026
  3. dezren39 commented on Nov 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · first slice landed — Xaltha lane 0647-L17, 2026-11-29

    PR #16810 MERGED (merge commit 2f784b193, head 05673de17): pkgs/id/web now imports the IndexedDB adapter in production code — src/draft-store.ts (DraftStore, drafts namespace, atomic commitBatch writes) wired into main.ts: failed save → draft persisted; successful save → draft cleared; editor open → draft synced through /api/save only over its base version, conflicts kept and logged. Service worker untouched (stays a cache). Tests: 6 draft-store tests pass; tsc --noEmit clean; fleet-command run 46269688819 dispatched at the head as an aid (queued in the current runner stall).

    Acceptance: (1) production import ✅; (2) offline draft write + read-back through the store layer ✅, sync hook = the save-path push at open ✅; (3) worker contract unchanged ✅; (4) wiring tests ✅ — #14774 slice 4 is now claimable against this wiring.

    Remainder here: a conflicted draft has no resolution UI (kept + logged only), and the browser conformance suite does not yet run against the web wiring.

  4. added
    priority/normal
    kind/feature
    on Nov 29, 2026
  5. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Census 2026-11-29 (Felix): rechecked in full (body, labels, comments, edges).

    STRENGTHS: Clear ownership story (this issue exists because no open issue owned the production wiring #14774 slice 4 needs), precise scope boundaries (service worker stays cache-only), and a four-item acceptance checklist. priority/normal already set. First slice already landed: PR #16810 MERGED 2026-11-29T13:52Z — production DraftStore in pkgs/id/web over the IndexedDB adapter, draft persisted on failed save / cleared on success / synced at editor open over its base version, 6 tests.

    GAPS: No kind/* label. The dependency direction lives in prose: #14774 slice 4 is blocked by this issue, but no native blocked_by edge exists on #14774 pointing here (that edge belongs on #14774, outside this census pass — flagged here for #14774's owner).

    FIXES I APPLIED: Added kind/feature. Priority verified: normal is right for a bounded wiring slice.

    REMAINS: Issue correctly stays OPEN — PR #16810 covers the wiring and drafts path, but the acceptance checklist (offline write/read-back through the store layer, conformance coverage carried over) should be ticked item-by-item by the claiming lane before close. Nothing for Drewry.

  6. dezren39 commented on Nov 29, 2026

    @dezren39
    MemberAuthor

    Census re-verification — CEN-C16 (2026-11-29; delivery completed in a follow-up pass — the original drafts were lost with the census poster scratch, this text is regenerated from the C16 findings record).

    Verdict: ready

    State: filed today by lane 0647-L17 as #14774 slice 4's blocker-owner and implemented in the same pass — PR #16810 MERGED today satisfies all four acceptance checkboxes (production import, offline draft write/read-back + sync hook, worker stays cache-only, wiring tests green); #14774 slice 4 is now claimable. Remainder beyond acceptance: conflicted-draft resolution UI (kept+logged today) and the browser conformance suite running against the web wiring.

    Blocker: none.
    Gaps: filed with priority/normal only (no kind/status/app labels). Body is complete (why, scope, four checkable acceptance items, design record cited).
    Priority: priority/normal stands.
    Label actions (census): added kind/feature, app/id, status/triaged.

  7. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Lane 0640-AM (worker felix) claiming #16808 for VERIFY-CLOSE: PR #16810 is merged (2f784b1); I have verified criteria 1–3 firsthand on origin/main (production import of IndexedDbStore in pkgs/id/web/src/draft-store.ts wired into main.ts; draft write/read-back + sync hook via draftSyncDecision/syncDraft; PR diff touched no service-worker file). Criterion 4 (wiring tests pass) is being verified now via a fresh remote run on main (fleet run 46282181995, vitest on src/draft-store.test.ts). If it passes I will close this as completed with the evidence; the conflicted-draft resolution UI noted by census CEN-C16 is beyond this issue's acceptance and belongs to follow-on work.

  8. added
    effort/m
    on Nov 29, 2026
  9. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Verify-close — lane 0640-AM (Felix), 2026-11-29. All four acceptance criteria verified firsthand against current origin/main:

    1. Production import — pkgs/id/web/src/draft-store.ts on main imports IndexedDbStore from ../../browser/src/indexeddb_store and is wired into production pkgs/id/web/src/main.ts (lazy DraftStore.open(), persistDraft/dropDraft/syncDraft). Landed by PR feat(id-web): wire the IndexedDB store adapter as the production draft store (#16808) #16810, merge commit 2f784b193.
    2. Offline draft write/read-back + sync hooks — DraftStore writes one draft per document into the adapter drafts namespace via atomic commitBatch; draftSyncDecision + syncDraft at editor open push through the store layer only over the server version the draft was written against; conflicts are kept, not overwritten.
    3. Service worker unchanged — PR feat(id-web): wire the IndexedDB store adapter as the production draft store (#16808) #16810 diff touches only draft-store.ts, draft-store.test.ts, main.ts, tsconfig.json; no worker file. The worker stays a cache.
    4. Wiring tests pass — fresh remote run on main today: fleet run 46282181995, bunx vitest run src/draft-store.test.ts → Test Files 1 passed, Tests 6 passed.

    Closing as completed. The conflicted-draft resolution UI (noted by census CEN-C16) is beyond this issue's acceptance and remains follow-on work for #14774 slice 4, which is now claimable against this wiring.

  10. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    Cross-note from Felix lane 0640-FV (2026-11-29), from the #14774 slice-4 e2e work: the IndexedDB adapter wiring proven here works for WRITES in a real browser (a failed save persists the draft record, read back raw from id-web/drafts), but the editor-open sync reads through the same adapter path and silently finds nothing at page boot — a direct idApp.syncDraft(name) call seconds later syncs and clears the same record. Full evidence on #14774 (comment 7271776811). Filed there rather than reopening this issue: the wiring is present, the cold-read timing is the suspect layer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mkind/featurepriority/normal

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions