Skip to content

docs(exploration): add AFFiNE BlockSuite integration feasibility analysis - #3

Merged
crs48 merged 3 commits into
mainfrom
codex/pr-0102-affine-blocksuite
Mar 5, 2026
Merged

docs(exploration): add AFFiNE BlockSuite integration feasibility analysis#3
crs48 merged 3 commits into
mainfrom
codex/pr-0102-affine-blocksuite

Conversation

@crs48

@crs48 crs48 commented Mar 5, 2026

Copy link
Copy Markdown
Owner

Summary\n- add exploration 0102 for AFFiNE BlockSuite integration feasibility\n- capture architecture fit, risks, and implementation considerations\n- place document under docs/explorations for review and follow-up planning\n\n## Testing\n- not applicable (documentation-only change)

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive feasibility exploration evaluating integration with an external suite, covering problem statements, architectural comparisons, data-model and feature overlap analyses, identified conflicts and risks, recommended integration strategies, component-reuse guidance, React API considerations, adapter-layer technical deep dives, mitigation approaches, and a phased implementation roadmap with milestones and validation criteria.

…ysis

- add exploration 0102 covering AFFiNE BlockSuite integration feasibility

- document architecture fit, risks, and implementation considerations

- preserve findings in docs/explorations for team review
@coderabbitai

coderabbitai Bot commented Mar 5, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 48fd73c2-913e-4dc1-9692-6f872c25d3c7

📥 Commits

Reviewing files that changed from the base of the PR and between 8b23d7e and 3753f67.

📒 Files selected for processing (1)
  • docs/explorations/0102_[_]_AFFINE_BLOCKSUITE_INTEGRATION_FEASIBILITY.md

📝 Walkthrough

Walkthrough

A comprehensive feasibility exploration document has been added that evaluates integrating AFFiNE/BlockSuite with xNet. The analysis covers architectural compatibility, identifies key conflicts (CRDT mismatch, storage paradigms, authorization gaps), compares feature overlaps, and recommends selective UX borrowing over full integration.

Changes

Cohort / File(s) Summary
Feasibility Exploration
docs/explorations/0102_[_]_AFFINE_BLOCKSUITE_INTEGRATION_FEASIBILITY.md
Added a ~1066-line feasibility study detailing problem statements, architecture comparisons, data-model mismatches, feature overlap scoring, critical conflicts, integration strategies (Full Adoption, UI Components Only, Reference Implementation), adapter design, implementation roadmap, risk assessment, validation criteria, and appendices.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through lines of plans and schemes,
To ponder merging canvases and dreams.
Where CRDTs clash and storages part,
I nibbled ideas, kept the best art.
Select the sparkle, keep the heart. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately summarizes the main change: adding a detailed feasibility analysis document for AFFiNE BlockSuite integration to the explorations directory.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/pr-0102-affine-blocksuite

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a thorough 1,066-line exploration document evaluating whether AFFiNE/BlockSuite can power xNet's docs, canvas, and database features. The document correctly identifies fundamental incompatibilities (CRDT data models, event-sourced vs. IndexedDB storage, workspace-level vs. node-level authorization) and recommends selective UX borrowing over full integration, backed by architecture diagrams, a phased roadmap, and a component-extraction checklist.

Key items:

  • The analysis is well-structured and the strategy recommendations (Strategy B for near-term component extraction, Strategy C as long-term reference implementation) are sound and internally consistent.
  • One editorial issue remains: the Product Risks table contains two contradictory rows for the same "Legal issues" risk — the original incorrect row (MPL 2.0 labeled as "permissive", severity 🟢 Low) was not removed when the corrected row (weak copyleft, 🟡 Medium) was added as a follow-up to a prior review. This leaves the table self-contradictory and should be resolved by deleting the stale first row.

Confidence Score: 3/5

  • Safe to merge after the duplicate risk-table row is resolved; document is documentation-only with no code impact.
  • The document is thorough and technically sound. The only blocking concern is the duplicate "Legal issues" row in the Product Risks table, which leaves an incorrect entry (MPL 2.0 as "permissive", 🟢 Low severity) alongside the corrected one — a direct internal contradiction that should be cleaned up before merging to avoid misleading future readers.
  • The risk assessment table in docs/explorations/0102_[_]_AFFINE_BLOCKSUITE_INTEGRATION_FEASIBILITY.md (lines 816–817) needs the stale duplicate row removed.

Important Files Changed

Filename Overview
docs/explorations/0102_[_]_AFFINE_BLOCKSUITE_INTEGRATION_FEASIBILITY.md Comprehensive 1,066-line feasibility analysis for AFFiNE/BlockSuite integration, covering architecture comparison, three integration strategies, component reuse priorities, a phased roadmap, and risk assessment. One structural issue: the Product Risks table contains a duplicate "Legal issues" row — the original incorrect row (MPL 2.0 labeled permissive, severity 🟢 Low) was not removed when a corrected row was added, creating a direct internal contradiction.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Start([Evaluate AFFiNE/BlockSuite Integration])
    Start --> Q1{Need full editor\nreplacement?}

    Q1 -- Yes --> StratA[Strategy A: Full Adoption]
    StratA --> A_result[❌ Not Viable\nBreaks event sourcing,\nschema system, auth model]

    Q1 -- No --> Q2{Need actual\nBlockSuite code?}

    Q2 -- Yes --> StratB[Strategy B: UI Components Only]
    StratB --> B_result[✅ Recommended\nCherry-pick widgets,\nwire to xNet hooks]
    B_result --> Adapter[Thin adapter layer:\nCommand / Event / State mappers]
    Adapter --> xNetCore[xNet Core Unchanged:\nevent sourcing · schema · UCAN auth]

    Q2 -- No --> StratC[Strategy C: Reference Implementation]
    StratC --> C_result[✅ Best Long-Term\nStudy UX patterns,\nrebuild natively]
    C_result --> NativeUI[Native components:\nTailwind + Base UI\nZero BlockSuite dependencies]
    NativeUI --> xNetCore

    xNetCore --> Deploy([Ship AFFiNE-inspired UX\nwith xNet architecture intact])
Loading

Last reviewed commit: 3753f67

Comment thread docs/explorations/0102_[_]_AFFINE_BLOCKSUITE_INTEGRATION_FEASIBILITY.md Outdated
Comment thread docs/explorations/0102_[_]_AFFINE_BLOCKSUITE_INTEGRATION_FEASIBILITY.md Outdated
crs48 and others added 2 commits March 5, 2026 15:33
…BILITY.md

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…BILITY.md

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@crs48
crs48 merged commit e987f97 into main Mar 5, 2026
@crs48
crs48 deleted the codex/pr-0102-affine-blocksuite branch March 5, 2026 23:34
Comment on lines +816 to +817

### Immediate Actions (This Week)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate "Legal issues" row — original incorrect entry not removed

The Product Risks table now has two consecutive rows for the same risk. It looks like the corrected row (line 817) was appended when addressing a previous review comment, but the original row (line 816) — which still carries the incorrect (permissive) label and an inconsistent 🟢 Low severity — was never removed. This leaves the table contradicting itself: the same risk is rated both 🟢 Low and 🟡 Medium.

The first row should be deleted so only the corrected entry remains:

Suggested change
### Immediate Actions (This Week)
| **Legal issues** - License or trademark concerns | 🟡 Medium | BlockSuite is MPL 2.0 (weak copyleft, file-level); do not copy source files — copy only visual patterns and interactions |

crs48 added a commit that referenced this pull request Mar 7, 2026
…ysis (#3)

* docs(exploration): add AFFiNE BlockSuite integration feasibility analysis

- add exploration 0102 covering AFFiNE BlockSuite integration feasibility

- document architecture fit, risks, and implementation considerations

- preserve findings in docs/explorations for team review

* Update docs/explorations/0102_[_]_AFFINE_BLOCKSUITE_INTEGRATION_FEASIBILITY.md

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update docs/explorations/0102_[_]_AFFINE_BLOCKSUITE_INTEGRATION_FEASIBILITY.md

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
crs48 added a commit that referenced this pull request Mar 7, 2026
…ysis (#3)

* docs(exploration): add AFFiNE BlockSuite integration feasibility analysis

- add exploration 0102 covering AFFiNE BlockSuite integration feasibility

- document architecture fit, risks, and implementation considerations

- preserve findings in docs/explorations for team review

* Update docs/explorations/0102_[_]_AFFINE_BLOCKSUITE_INTEGRATION_FEASIBILITY.md

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update docs/explorations/0102_[_]_AFFINE_BLOCKSUITE_INTEGRATION_FEASIBILITY.md

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
crs48 added a commit that referenced this pull request Jul 18, 2026
## Summary

- **Exploration 0343** — dimension-by-dimension scorecard of xNet's auth
stack vs Ink & Switch's
[Keyhive](https://www.inkandswitch.com/keyhive/notebook/); companion to
0325 (harvest lessons), fully implemented and checked off (`[x]`) — its
checklist was analysis-routing, not code.
- **Corrects a stale premise in both 0343 and 0335 blocker #2:** the
client's *action* wildcard is already fixed (explicit
`HUB_CAPABILITIES`, no more `hub/*`); the remaining residue is the
*resource* wildcard (`with: '*'`) + the `authorize.ts:146` capability
short-circuit, which still makes room ACLs advisory. Conclusion
unchanged: no same-hub confidentiality from authz until that's closed.
- **Amends 0325** per re-verification: C4's CGKA prerequisite narrowed
(ledger device records + epochs exist; the gap is per-device keypairs +
signing/encryption lineage split), and C2 can build on the existing
`rotateContentKey` grant-revocation coupling.
- **Records decisions:** 0335 sequencing (perimeter blockers #2/#3 stay
ahead of 0325-C1/C2); `pull` relay-only rung rejected for now
(hub-internal until 0258 zero-knowledge hubs exist).

Docs-only — no code changes; `skip-changelog`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
crs48 added a commit that referenced this pull request Jul 30, 2026
…(0410) (#658)

Implements exploration
`0410_[_]_OPEN_PR_TRIAGE_AND_THE_STRANDED_BRANCH_PROBLEM.md`, written in
the previous turn.

## What this closes out

Eight PRs were open, the oldest from March. Checking each one's **actual
diff against `main`** (rather than its description) found that four
described work already in `main`, re-derived and landed weeks later by
another route.

| PR | Age | Action taken |
| --- | --- | --- |
| #400 | 24d | **Closed** — fix landed on main in a better form; branch
predates 0391 and would have deleted `NodeLineRunner` |
| #9 | 145d | **Closed** — draft;
`apps/electron/src/renderer/workspace/` no longer exists |
| #595 | 11d | **Closed** — byte-identical to main (`fbc2965a2`) |
| #463 | 20d | **Closed** — main has a longer, `[x]` version of 0298 |
| #13 | 141d | **Closed** — both fixes on main verbatim |
| #505 | 17d | **Merged** — exploration 0318 + scale bench |
| #389 | 25d | **Merged** — exploration 0270 |
| #449 | 20d | **Rebuilt here** — see below |

`#400` was the load-bearing one: `git diff origin/main pr400 --
packages/devkit/src/command-runner.ts` showed ~150 lines of *deletion*
covering the whole 0391 streaming agent seam. Only its `CONFLICTING`
state had prevented that.

`#505`'s `build-and-smoke-test` went green on a rebase, confirming it
was branch staleness rather than the diff.

## The #449 rebuild (0290 bugs #2 and #3)

The original patched `apps/web/src/workbench/SyncStatus.tsx`, which 0406
deleted; the component now lives in `packages/workbench`, so the rebuild
lands on **desktop and web at once**.

- `WorkbenchHost` gains a `hub` capability (`configuredUrl` / `connect`)
so the shell can offer a way out of the disconnected state without
importing either app's `hub-url` module. `connect` returns a reason
string on rejection — never a silent no-op.
- `SyncStatus` exports `openSyncStatusPanel()`; the desktop popover and
mobile sheet both listen. The panel shows an inline hub-URL form while
there is no hub.
- `ShareDialog`'s `!ready` branch explains why a hub is needed and
offers **Connect a hub…**; private-hub links now confirm before copying.
- Adds `normalizeHubUrl` to the electron renderer's `hub-url` mirror (+4
unit tests), so a malformed URL is rejected loudly rather than
persisted.

Verified by driving the real app against a local hub — the CTA closes
the dialog and opens the panel; an invalid URL shows an error and
persists nothing; `https://hub.xnet.fyi/` normalises to
`wss://hub.xnet.fyi`; a `localhost` link's first Copy click asks "Copy
local-only link?" and writes nothing, the second copies. No console
errors. 0290 is now `[-]` at 11/20.

## Stopping the recurrence

Time-to-merge for the last 20 merged PRs was **0 hours median, 1 hour
max** — there is no review queue, so a PR that outlives its session is
abandoned, not pending.

- `.github/workflows/stale.yml` — warns at 14d, closes at 21d,
`keep-open` exempts. Named consumer (the maintainer, weekly) and a
decidable pass condition, per AGENTS.md.
- Fixed the `/explore` next-number command, which read only the working
tree and so handed out numbers already claimed on branches. Seven
explorations were found stranded that way.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant