8 Commits
Author SHA1 Message Date
DrSmoothl 3f2b474120 RoadMap: tick off #5 after the perf series lands
Three perf commits delivered the wins:
- f3f5d27 perf(bench): bench harness for receive/send chains (RoadMap #5 baseline)
- 0b6541c perf(sqlite): swap node:sqlite for better-sqlite3 + cache prepared stmts
- a70f194 perf(msg-push): drop Buffer.from() wrap on pkt.body (free allocation)

Headline numbers (RoadMap #5 baseline → after):

  Bridge — receive pipeline:
    group_member_join (full) 17.5 μs/op →  4.7 μs/op  (~3.7x)
    parseMsgPush text         0.29 μs/op →  0.25 μs/op (~1.2x)

  OneBot — send pipeline:
    storeMeta                17.0 μs/op → 10.9 μs/op  (~1.6x)
    storeEvent               23.2 μs/op → 18.2 μs/op  (~1.3x)
    findMeta hit              5.4 μs/op →  1.3 μs/op  (~4x)
    findMeta miss             3.7 μs/op →  0.7 μs/op  (~5x)
    findEvent hit             3.8 μs/op →  1.7 μs/op  (~2.3x)

  Combined send hot path:    ~40 μs → ~29 μs per message

Stopped here intentionally — the remaining knobs on the list
(elementsToJson sync-fast-path, WAL checkpoint policy, JSON
serialization swap, dedup-on-unchanged identity writes) have
diminishing returns vs the SQLite win we already cashed in.
Bench harness lives on; if real-world throughput pressure shows
up later, the baseline + delta methodology is already wired and
auditable.

All V2.0.0-pre items are now done.
2026-05-21 10:37:33 +08:00
DrSmoothl 450b551701 RoadMap: tick off #6 after the OneBot-side ctx slim-down lands
#6 was the "API层挂到ctx" item — Core side delivered the 13 typed
Api classes back in the e8d1af4...f4c6838 commit series; this turn
finished the OneBot side via the 4 ctx slim-down commits
(cb698d2 / 4c4ce60 / 8bf2ff3 / d983635).

ApiActionContext shrank from 90+ fields → ~30. Removed surfaces:
  - groupAdmin / groupFile / groupAlbum / friend / interaction /
    message / profile / web — all moved to direct
    `ctx.bridge.apis.<area>.method()` invocations.
Kept surfaces (real composition, not pass-through):
  - instance state: bridge / getLoginInfo / isOnline / getMessage*
  - module helpers: sendXxxMessage / sendXxxForwardMsg / forwardSingle /
    deleteMessage / setEssenceMsg / setMsgEmojiLike / handleGroupRequest
  - cache-backed reads: getFriendList / getGroupList / getGroupInfo
    /Member* / getStrangerInfo / getGroupFiles / get*MsgHistory /
    handleGetGroupSystemMsg / getDownloadRKeys
  - media store reads: getImageInfo / getRecordInfo

Full NapCat class-per-action conversion (TypeBox schemas / actionName
enum / auto-register decorator / 170 single-file classes) deliberately
not pursued — the metadata-driven design is meaningful only with
downstream doc/test tooling that consumes it, which SnowLuma doesn't
ship today. Marked as a follow-up under the same item if/when that
tooling appears.
2026-05-21 09:32:07 +08:00
DrSmoothl 72320121c3 RoadMap: tick off #3 after the 4-package split lands
Three phased commits delivered the split:
- 46b302f refactor(common): leaf utilities → @snowluma/common
- (the bridge phase commit) protocol layer → @snowluma/bridge
- (the onebot phase commit) translation layer → @snowluma/onebot

Final layout:

  packages/common/    ~8 files    logger / hex / packet-sender /
                                  protocol-types / runtime / json /
                                  log-file-transport / log-summary
  packages/bridge/    ~35 files   events / event-bus / identity /
                                  packet-pipeline / element-builder /
                                  bridge-oidb / qq-info / format /
                                  msg-push/* / highway/* / web/*
  packages/core/      ~32 files   bridge.ts (god-class) / bridge-
                                  interface / bridge-context (extends
                                  bridge package's slim BridgeContext
                                  with apis: ApiHub) / manager /
                                  apis/* (13 Api classes) / hook/* /
                                  webui/* / index.ts (app entry)
  packages/onebot/    ~43 files   actions/* / modules/* / network/* /
                                  event-converter/* / instance /
                                  instance-context / manager /
                                  message-{id,parser,store} /
                                  media-{store,indexer,url-resolver}
2026-05-21 08:52:54 +08:00
DrSmoothl e1c9ede9de RoadMap: tick off #2/#4 and partial #6 after the dev-branch refactor
- #2 (Proton ts+map fallback for unbundled debug) — landed in
  `994633e feat(proton): resolve bare specifiers via TypeScript module
  resolution` + `6c7e56d refactor(proto-defs)`. Bare specifiers like
  `@snowluma/proto-defs/oidb` now resolve to the original `.ts` source
  through `ts.resolveModuleName` (Bundler mode), so tsx/node + vite
  share the same import surface.

- #4 (proto definitions in their own package) — landed in
  `6c7e56d refactor(proto-defs)`. Moved 13 proto `.ts` files (~3.3k
  LOC) into the new `@snowluma/proto-defs` workspace package with
  per-file subpath exports; 44 call sites across core/tests rewritten.

- #6 (NapCat-style Api on ctx) — half done. Core side fully landed
  through 13 sequential commits (3e5dca1 → f4c6838) — `bridge.apis.<
  area>.method()` covers all 13 areas, `BridgeInterface` is gone, the
  `actions/*` directory is deleted. OneBot side is NOT done: actions
  still receive an `ApiActionContext` (a flat bag of functions) and
  call `ctx.bridge.apis.*` directly rather than going through a
  dedicated OneBot Api class layer.
2026-05-21 08:13:06 +08:00
手瓜一十雪 0464d6439f RoadMap: add Proton fallback approach for debug
Update the debug optimization item to specify a Proton fallback plan: implement unpackaged debug with correct data directory and use TypeScript + map-based type extraction for tsx and Node.js, which will be stripped during normal Vite builds.
2026-05-20 19:46:32 +08:00
手瓜一十雪 db412ad498 更新 RoadMap:拆分 core 与优化计划
在 RoadMap.md 中新增多项 v2.0.0 前计划:拆分 core 为 Common/OneBot/Core/Bridge、将 ProtocolBuffer 定义剥离到独立包、整理消息发送与解析链路以提升性能,并对齐 NapCat 设计(在 ctx 上挂载 Api 层)。这些条目明确了架构重构与性能优化的方向。
2026-05-20 19:43:33 +08:00
DrSmoothl 9a30a40a1f feat(core): add persistent identity service 2026-05-11 19:09:05 +08:00
手瓜一十雪 e008920f39 Add RoadMap.md and remove testing section
Remove the '测试要求' testing section from README.md and add a new RoadMap.md containing planned V2.0.0 tasks (unify Uid/Uin service with SQLite persistence, improve debug experience with no-packaging debug and correct data dir). This separates roadmap details from the README for clarity and future tracking.
2026-05-07 19:50:05 +08:00