Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/cli-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ concurrency:
jobs:
# ── Resolve version info (mirrors desktop-package.yml) ─────────────
prepare:
if: github.event_name != 'release' || !startsWith(github.event.release.tag_name, 'data-migrator-v')
name: Prepare
runs-on: ubuntu-latest
outputs:
Expand Down
112 changes: 112 additions & 0 deletions .github/workflows/data-migrator-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Data Migrator Package

on:
push:
tags: ['data-migrator-v*']
workflow_dispatch:

permissions:
contents: read

concurrency:
group: data-migrator-package-${{ github.ref }}
cancel-in-progress: false

jobs:
build:
name: Migrator (${{ matrix.platform }})
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- platform: windows-x64
os: windows-latest
target: x86_64-pc-windows-msvc
bundles: --no-bundle
- platform: macos-arm64
os: macos-15
target: aarch64-apple-darwin
bundles: --bundles dmg
- platform: macos-x64
os: macos-15-intel
target: x86_64-apple-darwin
bundles: --bundles dmg
- platform: linux-x64
os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
bundles: --bundles appimage
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v5
with:
node-version: '22.18.0'
cache: pnpm
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: swatinem/rust-cache@v2
with:
shared-key: data-migrator-${{ matrix.platform }}
cache-bin: false
- name: Install Linux WebView build dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- run: pnpm install --frozen-lockfile --ignore-scripts
- name: Verify independent version and packaging contract
run: |
node scripts/data-migrator-release.mjs --check-version
node --test scripts/data-migrator-tauri-build.test.mjs
- name: Check offline data compatibility
run: cargo test --locked -p openbitfun-data-migrator -p openbitfun-legacy-migration-adapters -p openbitfun-legacy-migration -p openbitfun-config-contracts --lib --test migration_engine_contracts
- name: Build independent package
run: pnpm run data-migrator:build -- --target ${{ matrix.target }} ${{ matrix.bundles }}
- name: Stage package and checksum
run: node scripts/data-migrator-release.mjs ${{ matrix.platform }}
- uses: actions/upload-artifact@v6
with:
name: data-migrator-${{ matrix.platform }}
path: target/data-migrator-release/${{ matrix.platform }}/*
if-no-files-found: error

draft-release:
if: startsWith(github.ref, 'refs/tags/data-migrator-v')
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: '22.18.0'
- uses: actions/download-artifact@v7
with:
pattern: data-migrator-*
path: migrator-release-assets
merge-multiple: true
- name: Sign and verify with the independent migrator release key
shell: bash
env:
OPENBITFUN_SIGNING_KEY: ${{ secrets.DATA_MIGRATOR_SIGNING_PRIVATE_KEY }}
OPENBITFUN_SIGNING_PASSWORD: ${{ secrets.DATA_MIGRATOR_SIGNING_PRIVATE_KEY_PASSWORD }}
OPENBITFUN_SIGNING_PUBKEY: ${{ secrets.DATA_MIGRATOR_SIGNING_PUBKEY }}
run: |
set -euo pipefail
test -n "$OPENBITFUN_SIGNING_KEY"
test -n "$OPENBITFUN_SIGNING_PUBKEY"
cat migrator-release-assets/*.sha256 | sort -k2 > migrator-release-assets/SHA256SUMS
(cd migrator-release-assets && sha256sum --check SHA256SUMS)
bash scripts/sign-release-assets.sh migrator-release-assets/*
node scripts/write-minisign-public-key.mjs --out migrator-release-assets/data-migrator.minisign.pub
- name: Create a separately reviewed release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ github.ref_name }}
name: OpenBitFun Data Migrator ${{ github.ref_name }}
draft: true
make_latest: false
files: migrator-release-assets/*
body_path: src/apps/data-migrator/RELEASE.md
1 change: 1 addition & 0 deletions .github/workflows/desktop-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ concurrency:
jobs:
# ── Resolve version info ───────────────────────────────────────────
prepare:
if: github.event_name != 'release' || !startsWith(github.event.release.tag_name, 'data-migrator-v')
name: Prepare
runs-on: ubuntu-latest
outputs:
Expand Down
48 changes: 43 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ members = [
"src/crates/services/services-core",
"src/crates/services/services-integrations",
"src/crates/services/legacy-migration",
"src/crates/services/legacy-migration-adapters",
"src/crates/services/miniapp-market-service",
"src/crates/services/skin-market-service",
"src/crates/services/relay-service",
Expand All @@ -46,6 +47,7 @@ members = [
"src/crates/execution/tool-provider-groups",
"src/crates/execution/tool-execution",
"src/crates/contracts/core-types",
"src/crates/contracts/config-contracts",
"src/crates/contracts/events",
"src/crates/contracts/runtime-ports",
]
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ OpenBitFun is still evolving. Here are three directions we want to explore:

Getting there means making long-running tasks more reliable, the runtime more efficient, and the desktop experience smoother.

## Optional legacy data migration

Data migration is optional and uses a **separately downloaded OpenBitFun Data
Migrator**. It runs independently and is not bundled with or launched by the main
application. See the [download, compatibility and recovery guide](src/apps/data-migrator/README.md).

## Build with it. Help shape it.

**Star OpenBitFun to follow along. Share what you build, offer feedback, or contribute code to help shape what comes next.**
Expand Down
6 changes: 6 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ OpenBitFun 仍在演进,我们希望继续探索三个方向:

更可靠的长任务、更高效的 Runtime、更从容的桌面体验,是这些探索共同的基础。

## 按需迁移旧版数据

数据迁移是可选操作,请按需**单独下载 OpenBitFun 数据迁移器**。工具独立运行,
不随主应用打包,也不会由主应用自动启动。下载、兼容范围、操作步骤与中断恢复见
[迁移器使用说明](src/apps/data-migrator/README.zh-CN.md)。

## 用它创造,也一起创造它

**欢迎用 Star 关注 OpenBitFun,用作品、反馈和代码参与它的未来。**
Expand Down
16 changes: 16 additions & 0 deletions docs/architecture/product-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -895,3 +895,19 @@ Shared Agent Runtime 是第一方多实例的目标部署,不是上表新增
启停顺序和失败回滚。这项宿主接入不构成 CLI、Server、ACP 或 HarmonyOS 本地产品支持。
- HarmonyOS PC 的完整目标同时包含本地 CLI/TUI 与 GUI,当前均不能标记可用;两种宿主分别验收,具体支持证据和禁止替代项以平台规约及各自专题为准。
- 文档、边界脚本和 focused 测试能说明本次变更保护了哪个稳定接口边界,或删除/降级了哪个过宽接口。

## 独立数据迁移工具的依赖边界

Data Migrator 是独立发布的本地离线工具,不依赖 Core、Product Assembly、Desktop 或 Web UI。
主应用不检测、启动或捆绑迁移器。两者在同一源码工作区复用稳定的数据格式与存储实现:

- contracts/config-contracts:配置 DTO、默认值、版本校验及到共享模型 DTO 的纯转换;Core 原路径保留转发,ConfigProvider 仍在 Core。
- services-core 的 workspace-persistence、coordination-store、session-event-format:工作区记录、注册表校验、SQLite 物理 schema 和会话日志格式。
- services/legacy-migration-adapters:旧版读取、转换、引用修复;只调用共享存储 owner。
- services/legacy-migration:快照、锁、暂存、备份、原子写入、日志恢复和无时效交接依赖的任务存储。

本次只移动数据/存储 owner,不移动 WorkspaceManager、会话生命周期、权限、事件或远程执行。
WorkspaceInfo/WorkspaceIdentity 的运行操作由 Core 的 runtime extension traits 保留,稳定记录无需导入这些能力。
原 Core 存储入口保留错误映射;可选 legacy-migration facade 保留旧导入路径,但不再由 product-full 启用。
远程四种场景不提供迁移工具的执行入口;仅转换本机保存的连接记录,不连接远端。
使用与发行契约以 [独立迁移器说明](../../src/apps/data-migrator/README.zh-CN.md) 为准。
21 changes: 9 additions & 12 deletions docs/architecture/product-customization-blueprint.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ C0a 实现一个构建期 JSONC 产品定义、严格解析器和确定性解析
当前真实消费者只有:

- Desktop build adapter:从解析结果覆盖 Tauri `productName`、`mainBinaryName` 与 bundle identifier;
- Data Migrator build adapter:从解析结果覆盖独立 Tauri 身份,并把 Desktop 与 Migrator 的 sibling binary name
编译进交接边界;
- CLI dev/build wrapper:从同一解析结果设置命令名、隔离定制构建缓存,并按成员 `binaryName` 暂存构建产物;
- First-party Rust artifacts:Desktop/Data Migrator/CLI build adapter 通过编译期环境注入 `productId`、
- First-party Rust artifacts:Desktop/CLI build adapter 通过编译期环境注入 `productId`、
`dataNamespace` 与由其派生的隐藏目录名,`openbitfun-core-types::product_identity` 作为最小事实 owner,供数据路径、Runtime
ownership、Remote Connect 与 Detached Dispatch 复用;

`product:check` / `product:explain` 只是构建作者的校验与解释工具,不计作产品字段的生产消费者。C0a 不生成无人读取的
通用产品 manifest 或 locale projection;三个 build adapter 直接消费同一次内存解析结果,Rust consumer
通用产品 manifest 或 locale projection;两个 build adapter 直接消费同一次内存解析结果,Rust consumer
只读取随对应产品 artifact 编译进去的不可变事实,不在运行时重新选产品。

产品定义 v1 仅包含已被这些消费者读取的字段,未知字段一律拒绝。localized 名称独立于技术 ID,并按共享 locale contract
Expand All @@ -37,7 +35,7 @@ GUI/TUI 布局、插件/内置扩展选择、Installer/Store target、更新与

### 0.1 当前定义与解析契约

产品定义描述一个 family,其中 Desktop、Data Migrator 与 CLI 是分别命名、分别消费的成员;Installer 与 Store 是可能的 Desktop
产品定义描述一个 family,其中 Desktop 与 CLI 是分别命名、分别消费的成员;Installer 与 Store 是可能的 Desktop
交付目标,不是独立成员,当前也没有对应实现。schema v1 只接受以下已消费字段:

```jsonc
Expand All @@ -51,11 +49,6 @@ GUI/TUI 布局、插件/内置扩展选择、Installer/Store target、更新与
"binaryName": "acme-desktop",
"bundleId": "com.acme.desktop"
},
"dataMigrator": {
"displayNameKey": "product.dataMigrator.name",
"binaryName": "acme-data-migrator",
"bundleId": "com.acme.data-migrator"
},
"cli": {
"displayNameKey": "product.cli.name",
"binaryName": "acme"
Expand All @@ -65,7 +58,7 @@ GUI/TUI 布局、插件/内置扩展选择、Installer/Store target、更新与
```

解析器先校验完整 family、双方 locale key、owned path 与技术 ID,再选择命令对应成员;digest-bearing `assembly`
只携带 schema/source digest、成员、display-name key、binary/bundle identity、交接所需 sibling binary names、
只携带 schema/source digest、成员、display-name key、binary/bundle identity、
locale contract facts 与 assembly digest。
构建 adapter 所需的源路径、localized 名称、输出目录和 default-product 标记保留在外围 build context,不扩展成通用
manifest。相同输入必须产生相同摘要;非默认产品使用 digest-scoped Cargo target 目录,避免复用其他产品的编译期身份。
Expand All @@ -79,9 +72,13 @@ i18n locale 集合和 key parity。

- 只修改默认产品定义或资源引用时运行 `pnpm run product:check`;非默认定义运行
`pnpm run product:check -- --product-config <path>`,确保校验实际改动的产品;
- 修改 schema、resolver 或 Desktop/Data Migrator/CLI build adapter 行为时,再运行 `pnpm run product:test`;
- 修改 schema、resolver 或 Desktop/CLI build adapter 行为时,再运行 `pnpm run product:test`;
- 打包和平台矩阵只在变更触及对应交付路径时运行,不作为产品定义的默认本地预检。

Data Migrator 已从产品 family 与 sibling binary 投影中移除,使用自己的版本、Tauri 身份、构建与发布工作流。
它固定面向 OpenBitFun 数据格式;工具身份与目标数据身份分开。旧定制产品定义应移除 `members.dataMigrator`。
详见 [迁移器 README](../../src/apps/data-migrator/README.zh-CN.md)。

## 1. 设计结论

产品定制只需要四类对象:
Expand Down
16 changes: 16 additions & 0 deletions docs/architecture/rust-build-dependency-boundaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,19 @@ cargo check -p <product> --timings

当前硬边界由 `scripts/check-core-boundaries.mjs` 统一执行。不要为同一 Cargo 架构事实增加第二个 checker;新增规则先证明当前树满足、fixture 能捕获回归,并保持错误消息可直接定位到 owner manifest。
检查器必须保持工作树只读;读取独立 manifest 的声明事实时不得生成新的 lockfile、target artifact 或格式化改动。

## 独立数据迁移工具的依赖边界

Data Migrator 是独立发布的本地离线工具,不依赖 Core、Product Assembly、Desktop 或 Web UI。
主应用不检测、启动或捆绑迁移器。两者在同一源码工作区复用稳定的数据格式与存储实现:

- contracts/config-contracts:配置 DTO、默认值、版本校验及到共享模型 DTO 的纯转换;Core 原路径保留转发,ConfigProvider 仍在 Core。
- services-core 的 workspace-persistence、coordination-store、session-event-format:工作区记录、注册表校验、SQLite 物理 schema 和会话日志格式。
- services/legacy-migration-adapters:旧版读取、转换、引用修复;只调用共享存储 owner。
- services/legacy-migration:快照、锁、暂存、备份、原子写入、日志恢复和无时效交接依赖的任务存储。

本次只移动数据/存储 owner,不移动 WorkspaceManager、会话生命周期、权限、事件或远程执行。
WorkspaceInfo/WorkspaceIdentity 的运行操作由 Core 的 runtime extension traits 保留,稳定记录无需导入这些能力。
原 Core 存储入口保留错误映射;可选 legacy-migration facade 保留旧导入路径,但不再由 product-full 启用。
远程四种场景不提供迁移工具的执行入口;仅转换本机保存的连接记录,不连接远端。
使用与发行契约以 [独立迁移器说明](../../src/apps/data-migrator/README.zh-CN.md) 为准。
7 changes: 7 additions & 0 deletions docs/architecture/theme-token-optimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,13 @@ Mobile Web 直接消费 `@openbitfun/theme-openbitfun`。`ThemeProvider` 与首

### Desktop bootstrap 与 Native Mobile 预览

Data Migrator 的独立静态界面直接消费设计系统公开的字体、间距、控件和语义颜色 Token。
`generate-data-migrator-theme.mjs` 构建设计系统的 Token/主题包,并将公开 CSS 入口及其依赖打包为
`src/apps/data-migrator/ui/generated/design-system.css`,随迁移程序离线交付。原生控件只使用 canonical
Token;`theme.js` 在首屏绘制前选择系统浅色/深色和高对比模式,并监听系统设置变化。
仅独立迁移器打包刷新该资源,开发者也可显式运行生成命令;Desktop 开发和打包不依赖迁移器。
统一颜色审计同时检查源码和生成物漂移。

Desktop 的更新确认页和启动页只消费 `src/apps/desktop/src/generated/bootstrap_theme.css` 发布的 canonical
`--openbitfun-*`,不得内联另一套启动色。该 CSS 和两个 Appearance manifest 一起由
`generate-startup-appearance-bootstrap.mjs` 从正式主题/Appearance 源生成;统一颜色审计执行 `--check`,
Expand Down
Loading
Loading