chore(phase-4): delete dead Phase-3 plaintext plumbing + sync CLAUDE.md#38
Merged
Conversation
The codebase has fully moved to the Phase-4 `v1.<nonce>.<ct>` envelope since pre-v0.1.0-beta. 28 call sites across workspaces, boards, cards and the card-drawer use `encryptToEnvelope`/`decryptFromEnvelope`; zero call sites use `encodeBlob`/`decodeBlob`. ADR 0007 is "executed". Removed: - `src/lib/encoding/plaintext-blob.ts` — `encodeBlob` / `decodeBlob` / `isPhase3Blob` are gone. No consumers, just deprecated dead code. - `tests/unit/plaintext-blob.test.ts` — covered the removed helpers. - `scripts/migrate-phase3-to-e2ee.ts` — one-shot migration tool. There are no Phase-3 plaintext installations in the wild (the project was pre-tag when Phase 4 landed, and README/ADR 0007 explicitly said "do not put production data on it" until v1.0). Operators with a pre-beta snapshot install need to wipe + re-create workspaces. - Empty `src/lib/encoding/` directory. Synced: - CLAUDE.md status line + "Letzte Aktualisierung" + Phase 4 row (⚪ → ✅, with concrete pointers to the crypto lib + client-prelude + the 28 envelope call sites) + Phase 3 row (Plaintext-Wrapper note removed) + Phase 2 row (placeholder client-prelude note removed — the real one has landed). - ADR-Übersicht: 0007 marked "executed", 0009 (MK session) added. - "Bekannte Risiken" §15: Phase-3 → Phase-4 migration risk struck out and annotated with the actual outcome. - CHANGELOG.md: new "Removed" + "Fixed" sections under [Unreleased], plus the afternoon's 14-PR Dependabot sweep recorded under "Changed". Tests: - `pnpm typecheck` clean - `pnpm lint` clean - `pnpm test` — 107/107 pass (was 111, −4 plaintext-blob cases) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Musiker15 <info@musiker15.de>
Musiker15
added a commit
that referenced
this pull request
May 29, 2026
…API, correct overstated docs Phase A of the gaps backlog (#43, #44, #45, #51): additive cleanup + doc truth, no runtime behaviour change. - Remove unused deps never imported in src/: @tanstack/react-query, bullmq, iron-session, socket.io(+client). Delete the never-wired tests/msw skeleton and drop msw from devDependencies. - CLAUDE.md sections 2/6: correct tech-stack to reality (self-written auth not Auth.js, native ws not socket.io, in-process schedulers not BullMQ, libsodium crypto_pwhash not argon2-browser, fetch+Zustand not TanStack Query). - OpenAPI -> v0.6.0: document the previously-missing Milestones, Automation and account/auth-settings routes; fix the wrong route count (~70 handlers). - Clarify /api/auth/2fa/verify is not a standalone endpoint (verification runs inside /api/auth/login). - threat-model.md + CLAUDE.md truth pass: exponential backoff is prepared but unwired (#27); safe-regex (#30) / HIBP (#29) / login-notification emails (#32) are planned-not-built; Markdown is escaped plaintext (no render -> no DOMPurify sink yet, #33); offline is read-only + description drafts (no Workbox/write sync-queue, #38); live cursors sit behind a default-off flag (ADR 0011); style-src still uses unsafe-inline; Apache must set no Content-Security-Policy. Typecheck, ESLint and the 193-test suite all pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Musiker15
added a commit
that referenced
this pull request
May 30, 2026
Two halves (ADR 0021), no Workbox dependency: A) Cold-start offline. `scripts/gen-precache-manifest.mjs` (run in `pnpm build`) emits public/precache-manifest.json listing the build's hashed JS/CSS + shell, versioned by the Next build id. The hand-rolled SW precaches it on install → installed PWA boots fully offline. Runtime: cache-first for immutable /_next/static/, network-first for navigations, /api/ never cached. Manifest is gitignored (regenerated per build). B) Offline write outbox. `queuedFetch` (src/lib/offline/sync.ts) is a fetch drop-in: online it fetches; offline (or on a network throw) it persists the intent to an IndexedDB outbox (src/lib/idb/outbox.ts) and reports `queued`, so the caller keeps its optimistic UI. `flushOutbox` replays oldest-first on reconnect + on mount, driven by the new OfflineSync header pill (+ conflict toast). Server stays authority: permanent 4xx drops the change (LWW + toast); transient error keeps the ordered tail. v1 queues only naturally-idempotent, no-return ops — card move/reorder, metadata + archive (PATCH /api/cards/[id]), checklist-item toggle — so a double replay is harmless and NO server route / idempotency key changed. Wired in board-client (moveCard) + card-drawer (saveMeta/archive/ toggleItemDone). Offline create + comment-edit deferred (need client ids / temp-id reconciliation), documented in ADR 0021. Zero-knowledge preserved: queued bodies are already enc_* envelopes, so the outbox holds ciphertext + structural metadata only — never plaintext. Wiped on logout (key-bundle reset), like the read cache + Yjs drafts. Shared IndexedDB handle extracted to src/lib/idb/db.ts (DB v2: boards + outbox stores); board-cache refactored onto it. OnlineStatus' "will sync on reconnect" promise is now honest. Tests: tests/unit/outbox.test.ts (+7) — classifyReplay + flushOutbox (success / drop-and-continue / transient-stop / network-throw). typecheck/ lint/tests green (294). Docs: ADR 0021 (new), CLAUDE.md (§5.1, header, ADR table — full #27–#51 backlog now complete), CHANGELOG. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CLAUDE.md drifted from the actual codebase: it still marks Phase 4 as ⚪ offen, but the E2EE layer has been fully wired for months — 28
encryptToEnvelope/decryptFromEnvelopecall sites across workspace, board, card and card-drawer clients; zero call sites left for the Phase-3encodeBlob/decodeBlobhelpers. ADR 0007 ("plaintext first, E2EE-migrate later") is "executed".This PR finishes the bookkeeping:
Removed (~280 lines)
src/lib/encoding/directorySynced
Why now
Today's CI sweep + the otplib migration kept hitting the stale Phase-3 references in JSDoc/links. Easier to remove them in one shot than to keep tripping over them.
Test plan
pnpm typecheckcleanpnpm lintcleanpnpm test— 107/107 (was 111, −4 plaintext-blob cases)No runtime change. Pure deletion + docs.
🤖 Generated with Claude Code