Skip to content

id: implement Notion importer slice 2: page/block core + link rewriting + files (design #6436) #13522

Closed

Description

@dezren39

Implementation slice 2 of the Notion importer design for #6436, landed as doc/2026-11-10_design_id6436.md (PR #8416, amended PR #8558). Parent implementation issue: #6513. Slice 1 (manifest + inventory, #8419) has landed; this is the next slice in the design's implementation slicing.

Scope (design §2.1, §2.5, §3, §4; Implementation slicing item 2):

  • Identity assignment pass: fill the manifest's page UUID → note ID map and block UUID → (note ID, block identity) map, idempotently — an assignment, once recorded, never changes on re-import (§6.1).
  • Page/block core: rebuild each page's block tree from fresh block-children responses (sibling order preserved), and convert the clean classes of §2.5 (paragraph, headings, lists, to-do, quote, code, divider, bookmark) into the note revision content form, with child pages as typed references to their own notes. Every block is classified clean / degraded / unsupported; unsupported blocks are preserved verbatim, never dropped (§2.5).
  • Two-pass link rewriting (§3): identity is assigned for the whole inventory before any content converts, so page links, mentions, and block links (#<block-uuid>) rewrite to typed references through the manifest map; a link whose target is outside the import set stays a verbatim external URL and is counted as externalised.
  • Files (§4): file-bearing blocks are fetched during the run through an injected fetcher boundary; blobs are keyed by their BLAKE3-256 content hash (the model's raw-blake3-256 profile), duplicate bytes are stored once, and the manifest records source file ↔ blob. A file that cannot be fetched degrades its page with a named missing-resource reason and never aborts the import.

Acceptance:

  • Offline fixture tests over recorded block-children responses: converting the fixture pages yields the expected content trees, typed references, and manifest maps (design §8 checks 2 and 6, page/block subset).
  • Re-running identity assignment and conversion over an unchanged corpus changes nothing: no new note IDs, byte-identical content (design §8 check 3, conversion level).
  • No credentials persisted (§6.5): file URLs arrive only through the injected boundary at fetch time and are never recorded in the manifest or content.

Later slices: 3 databases (schema claims, relations, rollups/formulas); 4 comments + degradation classes + hybrid export matching; 5 fidelity report + incremental re-import.

Activity

  1. added
    kind/feature
    task/small-fix
    priority/normal
    app/id
    effort/l
    epic/id-program
    on Nov 23, 2026
  2. developing-today commented on Nov 23, 2026

    @developing-today
    Contributor
  3. added a commit that references this issue on Nov 23, 2026
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

    app/ideffort/lepic/id-programkind/featurepriority/normalstatus:donetask/small-fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions