清理历史 Electron、Graphify、沙箱和截图等仓库跟踪残留,补充 CodeGraph 与 Convex active deploy source 协作说明。 新增 tree-first 下一阶段设计稿和 2026-05-20 清理总结,记录本地工作区、路径身份和 Zed/Lapce/VSCode 参考收口方向。 扩展 Rust Web 本地文件夹、DocumentBuffer、mindmap 资源、tree runtime 和页面聚合链路,并补充 task455 local-folder mindmap clean smoke。 验证:git diff --check 通过;pnpm store status --store-dir .pnpm-store 通过;npm ls --depth=0 --json 通过;find -L node_modules 未发现断链。cargo test -p mnote-web 当前 418 passed / 35 failed。
4.5 KiB
4.5 KiB
MNOTE — Reasonix working knowledge
Stack
- Rust — workspace of 11 crates, edition 2021, resolver 2, wasm32 target (
rust/rust-toolchain.toml) - Axum 0.8 — HTTP/WebSocket server in
mnote-webcrate - Leptos 0.8.14 — SSR island rendering in
mnote-web - Convex 1.x — self-hosted document/real-time/storage backend (
infra/convex/docker-compose.yml) - Playwright — browser smoke tests in
scripts/task-*.js
Layout
| Path | Contents |
|---|---|
rust/crates/mnote-web/ |
Rust web gateway (axum + Leptos SSR, :3000) |
rust/crates/core-protocol/ |
Kernel types, projection protocol, tree/graph terms |
rust/crates/bridge-runtime/ |
Kernel query/command, Convex transport args generation |
rust/crates/mnote-cli/ |
CLI tool (sidebar dataset, page get/create/title/save/move, block insert/patch) |
rust/crates/storage-convex-bridge/ |
Convex storage bridge for Rust |
convex/ |
Convex schema (schema.ts) + functions (aiSessions.ts) |
infra/convex/ |
Docker Compose for self-hosted Convex backend |
infra/onlyoffice/ |
Docker Compose for OnlyOffice |
scripts/ |
Node.js dev/build scripts + Playwright smoke tests |
design/ |
Architecture design documents organized by domain |
bugs/ |
Bug tracking mirroring design domain structure |
recycle/ |
Retired code (old frontend, deprecated design drafts) |
Commands
npm run desktop:hot— hot-reload dev start (Rust gateway + optional FastAPI backend + optional Celery)npm run dev:hot— same but withcargo-watchfor Rust auto-recompilenpm run desktop— production startcargo test -p <crate>— test a specific Rust cratecargo run -p mnote-web --bin mnote-web— run the web server binary directlycodegraph sync .— refresh CodeGraph after normal code changescodegraph index . --force— rebuild CodeGraph after large refactors, ignore-rule changes, or stale index behavior
CodeGraph MCP
- Reasonix has
codegraph=codegraph serve --mcpconfigured in/home/lix/.reasonix/config.json. - Prefer CodeGraph for structural code questions: symbol lookup, definitions, callers/callees, impact analysis, and focused cross-file context.
- Use
codegraph_searchfor symbol names,codegraph_callers/codegraph_calleesfor call flow,codegraph_impactbefore risky edits,codegraph_contextfor focused task context, andcodegraph_files/codegraph_statusfor index inspection. - Use native search only for literal text, comments, log messages, or after a specific file is already identified.
- Keep the project index fresh in development: run
codegraph sync .after code changes; usecodegraph index . --forcewhen the index looks stale or after broad restructuring.
Conventions
- Smoke test pattern: standalone Playwright scripts under
scripts/task-*.jsusing a shared harness (ensureAuthenticated,createTempDocument,cleanupDocuments). All use"use strict"andrequire("playwright")(scripts/task110-page-title-single-truth-smoke.js:1-4). - Rust workspace: edition 2021, resolver "2", MIT license. All crates inherit workspace version (
rust/Cargo.toml:2-8). - Convex boundary: root
convex/is the active deploy source for ACP / Hermes runtime state (schema.ts+aiSessions.ts). Do not deploy fromrecycle/wolai-frontend/convex; olddocuments/mediaAssets/users/workspacesfunctions must be explicitly migrated to active code, moved to an auxiliary area, or retired. - Bug tracking: bugs organized by design domain directory (e.g.
bugs/04-tree-domain/process/), moved todone/when fixed (bugs/README.md). - Design docs: organized by domain in
design/, withprocess/(in-progress) anddone/(completed) subdirs (design/README.md).
Watch out for
- write_file path rule: paths are sandbox-relative; leading
/is stripped. Usepath: "design/..."not/mnt/Data1T/mnote/design/.... .aionrs/,.claw/,.codex/,.gemini/— session data from other AI tools, not project code. Don't read or edit.recycle/— retired code, not current implementation. Don't use as evidence for current behavior.- Convex must be running (
infra/convex/) for full-stack dev — smoke tests depend on a live Convex backend. - Rust wasm32 target required (
rust/rust-toolchain.toml), needed fortree-shell-runtime-wasmcrate. rust/target/is gitignored and large —cargo buildruns from scratch if cache is missing.