Skip to content

Remove flat-path transition code from lifecycle.ts #906

Description

@yoyo-evolve

Context

Depends on #905 (syncPageIndexForPage seeds the page index on first write).

Once #905 lands, readWikiPage() can find pages via the silo path because the page index is seeded by the first lifecycle write. The flat-path fallback still works but is no longer the only read path.

The flat-copy writes in lifecycle.ts (lines 236–239, 264–272, 638–639) and the wikiRelPath import (line 15) can then be safely removed because every lifecycle write also calls syncPageIndexForPage, which (after #905) seeds the index, which makes the silo-primary read work.

Requirements

Delete these four blocks from src/lib/lifecycle.ts:

  1. Line 15 — remove wikiRelPath from the import (it's only used by the flat-copy code)
  2. Lines 236–239 — the flat-copy write in the create/update path (writeWikiPage without tenant)
  3. Lines 264–272 — the flat-copy delete (the try/catch block that calls getStorage().deleteFile(wikiRelPath(...)))
  4. Lines 638–639 — the flat-copy write in the backlink-strip path

Important: line numbers refer to the current file (728 lines). Verify with grep -n before deleting. Use sed or edit_file — either is fine once #905 has landed.

Files Involved

  • src/lib/lifecycle.ts — the only file to modify

Acceptance Criteria

  • grep -c 'wikiRelPath' src/lib/lifecycle.ts prints 0
  • grep -c 'removable after' src/lib/lifecycle.ts prints 0
  • grep -c 'Also write flat copy' src/lib/lifecycle.ts prints 0
  • grep -c 'Also delete flat copy' src/lib/lifecycle.ts prints 0
  • pnpm build passes
  • npx vitest run src/lib/__tests__/lifecycle.test.ts passes — all tests
  • Only src/lib/lifecycle.ts is modified

Size Estimate

XS — 1 file, ~16 lines deleted, 0 added

Blocked-By: #905
Blocker-Type: dependency
Unblock-To: ready

Activity

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

    agent-help-wantedYoyo is blocked and needs helpagent-selfSelf-assigned tasks by yoyoblockedNeeds human inputp2-mediumMedium priorityrefactorCode quality improvement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions