Skip to content

Commit 6b82447

Browse files
committed
feat(build): add mirror-first sidecar supply
1 parent 10627ff commit 6b82447

51 files changed

Lines changed: 5502 additions & 439 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@
4343
*.aab binary
4444
*.keystore binary
4545
*.jks binary
46-
src/frontend/graph_data.json filter=lfs diff=lfs merge=lfs -text
47-
src/frontend/data.js filter=lfs diff=lfs merge=lfs -text
48-
src-tauri/bin/node-x86_64-pc-windows-msvc.exe filter=lfs diff=lfs merge=lfs -text
4946
src-tauri/bin/server-x86_64-pc-windows-msvc.exe filter=lfs diff=lfs merge=lfs -text
5047
src-tauri/bin/godot-x86_64-pc-windows-msvc.exe filter=lfs diff=lfs merge=lfs -text
5148
src-tauri/bin/server-x86_64-unknown-linux-gnu filter=lfs diff=lfs merge=lfs -text

.github/workflows/release-desktop-multi-os.yml

Lines changed: 81 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ permissions:
2020

2121
env:
2222
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
23+
GODOT_MIRROR_TAG: "godot-mirror-v4.3-stable"
24+
GODOT_UPSTREAM_BASE_URL: "https://github.com/godotengine/godot/releases/download/4.3-stable"
25+
GODOT_WINDOWS_ARCHIVE_NAME: "Godot_v4.3-stable_win64.exe.zip"
26+
GODOT_LINUX_ARCHIVE_NAME: "Godot_v4.3-stable_linux.x86_64.zip"
27+
GODOT_MACOS_ARCHIVE_NAME: "Godot_v4.3-stable_macos.universal.zip"
2328

2429
jobs:
2530
ensure-release:
@@ -61,9 +66,64 @@ jobs:
6166
gh release create "$TAG_NAME" --title "$TAG_NAME" --notes "Automated desktop multi-OS release assets."
6267
fi
6368
69+
ensure-godot-mirror-assets:
70+
name: Ensure Godot Mirror Assets
71+
needs: ensure-release
72+
runs-on: ubuntu-latest
73+
74+
steps:
75+
- name: Ensure Godot mirror release exists
76+
env:
77+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
shell: bash
79+
run: |
80+
if gh release view "$GODOT_MIRROR_TAG" >/dev/null 2>&1; then
81+
echo "Godot mirror release already exists: $GODOT_MIRROR_TAG"
82+
else
83+
gh release create "$GODOT_MIRROR_TAG" \
84+
--title "$GODOT_MIRROR_TAG" \
85+
--notes "Project-controlled mirror for Godot desktop bootstrap archives."
86+
fi
87+
88+
- name: Seed Godot mirror assets from upstream when missing
89+
env:
90+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
shell: bash
92+
run: |
93+
set -euo pipefail
94+
mkdir -p build/godot-mirror
95+
mapfile -t EXISTING_ASSETS < <(gh release view "$GODOT_MIRROR_TAG" --json assets --jq '.assets[].name')
96+
97+
has_asset() {
98+
local needle="$1"
99+
local asset
100+
for asset in "${EXISTING_ASSETS[@]}"; do
101+
if [ "$asset" = "$needle" ]; then
102+
return 0
103+
fi
104+
done
105+
return 1
106+
}
107+
108+
for ASSET_NAME in \
109+
"$GODOT_WINDOWS_ARCHIVE_NAME" \
110+
"$GODOT_LINUX_ARCHIVE_NAME" \
111+
"$GODOT_MACOS_ARCHIVE_NAME"
112+
do
113+
if has_asset "$ASSET_NAME"; then
114+
echo "Mirror asset already present: $ASSET_NAME"
115+
continue
116+
fi
117+
118+
ARCHIVE_PATH="build/godot-mirror/$ASSET_NAME"
119+
curl -fsSL "${GODOT_UPSTREAM_BASE_URL}/${ASSET_NAME}" -o "$ARCHIVE_PATH"
120+
gh release upload "$GODOT_MIRROR_TAG" "$ARCHIVE_PATH" --clobber
121+
echo "Uploaded mirror asset: $ASSET_NAME"
122+
done
123+
64124
build-and-upload:
65125
name: Build and Upload (${{ matrix.platform_label }})
66-
needs: ensure-release
126+
needs: [ensure-release, ensure-godot-mirror-assets]
67127
runs-on: ${{ matrix.runner }}
68128
strategy:
69129
fail-fast: false
@@ -135,7 +195,16 @@ jobs:
135195
$ErrorActionPreference = "Stop"
136196
New-Item -ItemType Directory -Path "build\godot" -Force | Out-Null
137197
$archive = "build\godot\godot-win64.zip"
138-
Invoke-WebRequest -Uri "https://github.com/godotengine/godot/releases/download/4.3-stable/Godot_v4.3-stable_win64.exe.zip" -OutFile $archive
198+
$mirrorBaseUrl = "https://github.com/Jacobinwwey/NoteConnection/releases/download/$env:GODOT_MIRROR_TAG"
199+
$mirrorUrl = "$mirrorBaseUrl/$env:GODOT_WINDOWS_ARCHIVE_NAME"
200+
$upstreamUrl = "$env:GODOT_UPSTREAM_BASE_URL/$env:GODOT_WINDOWS_ARCHIVE_NAME"
201+
try {
202+
Invoke-WebRequest -Uri $mirrorUrl -OutFile $archive
203+
Write-Host "Downloaded Godot archive from project mirror: $mirrorUrl"
204+
} catch {
205+
Write-Warning "Project mirror download failed, falling back to upstream: $upstreamUrl"
206+
Invoke-WebRequest -Uri $upstreamUrl -OutFile $archive
207+
}
139208
Expand-Archive -Path $archive -DestinationPath "build\godot\extract" -Force
140209
$godotExe = Get-ChildItem -Path "build\godot\extract" -Filter "Godot_v4.3-stable_win64.exe" -Recurse | Select-Object -First 1
141210
if (-not $godotExe) {
@@ -155,7 +224,11 @@ jobs:
155224
run: |
156225
set -euo pipefail
157226
mkdir -p build/godot
158-
curl -fsSL "https://github.com/godotengine/godot/releases/download/4.3-stable/Godot_v4.3-stable_linux.x86_64.zip" -o build/godot/godot-linux.zip
227+
MIRROR_BASE_URL="https://github.com/Jacobinwwey/NoteConnection/releases/download/${GODOT_MIRROR_TAG}"
228+
if ! curl -fsSL "${MIRROR_BASE_URL}/${GODOT_LINUX_ARCHIVE_NAME}" -o build/godot/godot-linux.zip; then
229+
echo "Project mirror download failed, falling back to upstream."
230+
curl -fsSL "${GODOT_UPSTREAM_BASE_URL}/${GODOT_LINUX_ARCHIVE_NAME}" -o build/godot/godot-linux.zip
231+
fi
159232
unzip -q -o build/godot/godot-linux.zip -d build/godot/extract
160233
GODOT_BIN="$(find build/godot/extract -maxdepth 2 -type f -name 'Godot_v4.3-stable_linux.x86_64' | head -n 1)"
161234
if [ -z "${GODOT_BIN}" ]; then
@@ -171,7 +244,11 @@ jobs:
171244
run: |
172245
set -euo pipefail
173246
mkdir -p build/godot
174-
curl -fsSL "https://github.com/godotengine/godot/releases/download/4.3-stable/Godot_v4.3-stable_macos.universal.zip" -o build/godot/godot-macos.zip
247+
MIRROR_BASE_URL="https://github.com/Jacobinwwey/NoteConnection/releases/download/${GODOT_MIRROR_TAG}"
248+
if ! curl -fsSL "${MIRROR_BASE_URL}/${GODOT_MACOS_ARCHIVE_NAME}" -o build/godot/godot-macos.zip; then
249+
echo "Project mirror download failed, falling back to upstream."
250+
curl -fsSL "${GODOT_UPSTREAM_BASE_URL}/${GODOT_MACOS_ARCHIVE_NAME}" -o build/godot/godot-macos.zip
251+
fi
175252
unzip -q -o build/godot/godot-macos.zip -d build/godot/extract
176253
GODOT_BIN="$(find build/godot/extract -type f -path '*Godot.app/Contents/MacOS/Godot' | head -n 1)"
177254
if [ -z "${GODOT_BIN}" ]; then

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ tmp
6969
# Local docs deploy/build artifacts
7070
.edgeone/
7171
build/mkdocs-site/
72+
.venv-mkdocs/

README.md

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 2026-03-31 v1.7.0
1+
# 2026-04-07 v1.7.0
22

33
# NoteConnection Knowledge Graph
44

@@ -166,10 +166,15 @@ NoteConnection now supports **two Android generation paths**:
166166
1. **Capacitor APK path** (web-asset runtime, stable for reader/visualization workflows).
167167
2. **Tauri Android path** (native shell pipeline aligned with `docs/tauri_brainstorming.md`).
168168

169+
Build/release/runtime details are audited in:
170+
171+
- `docs/en/multi_platform_build_flow_audit.md`
172+
- `docs/zh/multi_platform_build_flow_audit.md`
173+
169174
#### Prerequisites
170175

171176
- **Node.js** (LTS)
172-
- **Java JDK** (17 or higher)
177+
- **Java JDK** (21 or higher)
173178
- **Android SDK** (Configured in `ANDROID_HOME` or via Android Studio)
174179

175180
#### Method A: Capacitor Build (Stable)
@@ -224,8 +229,8 @@ npm run tauri:android:build
224229

225230
#### Mobile Capability Boundary
226231

227-
- Capacitor path currently packages web assets and does not embed the local Node sidecar workflow (`/api/build`, `/api/folders`, `/api/content`).
228-
- Tauri Android path is provided as the native-shell migration route and should be used when mobile-side parity with the Tauri architecture is required.
232+
- Capacitor packaging path does not embed the desktop Node sidecar workflow, but native Capacitor runtime can still build graph payloads locally when Filesystem APIs are available and the dataset stays within mobile limits.
233+
- Tauri Android path provides the native-shell runtime route and uses Android-native `build_graph_runtime` when mobile-side parity with the Tauri architecture is required.
229234

230235
### 3. Usage Guide
231236

@@ -327,12 +332,19 @@ max_doc_bytes = 100663296
327332
328333
## 🏗️ Build & Deployment
329334
330-
For developers building from source, NoteConnection offers two build modes:
335+
For developers building from source, NoteConnection now defaults to the runtime-first path:
331336
332337
- **Electron desktop pipeline was removed on 2026-03-01 (deprecated and decommissioned).**
333338
334-
- **Tauri Full Build (`npm run tauri:build`)**: Builds desktop package with full frontend assets.
335-
- **Tauri Mini Build (`npm run tauri:build:mini`)**: Builds desktop package excluding large pre-generated graph data files.
339+
- **Tauri Build (`npm run tauri:build`)**: Default desktop package path. Uses runtime-first assets and excludes pre-generated graph payloads.
340+
- **Tauri Mini Build (`npm run tauri:build:mini`)**: Legacy-compatible alias of the same runtime-first packaging path.
341+
- **Tauri Full Graph Build (`npm run tauri:build:full`)**: Explicit opt-in path for including generated graph assets when real files are present locally.
342+
- **Build (`npm run build`)**: Default runtime-first frontend build.
343+
- **Build Full Graph Assets (`npm run build:full`)**: Explicit opt-in frontend build for local/demo scenarios that need pre-generated graph assets.
344+
- **Godot Bootstrap** (`npm run prepare:godot:bin`): materializes the host Godot sidecar from local overrides/search paths, cache, or a pinned download URL.
345+
- **Desktop Release Godot Mirror**: release CI now seeds a project-controlled GitHub Releases mirror tag for Godot archives, then downloads mirror-first with upstream fallback.
346+
- **LFS Policy Guard** (`npm run verify:lfs:policy`): blocks new Git LFS drift under `src/frontend/` and `src-tauri/bin/` while migration still carries legacy exemptions. Future strict mode is available via `npm run verify:lfs:policy:strict`.
347+
- **Sidecar Supply Readiness** (`npm run verify:sidecar:supply`): reports whether the current desktop host is offline-ready or still network-dependent before shrinking the remaining sidecar LFS bridge.
336348
- **GPU Dev Start (`npm run tauri:dev:mini:gpu`)**: Recommended GPU-enabled Tauri development command.
337349
- **Do not use** `npm run tauri:dev:mini --gpu` because npm treats `--gpu` as config and prints warnings.
338350
@@ -349,6 +361,8 @@ For developers building from source, NoteConnection offers two build modes:
349361
- Recommended lookup entry points:
350362
- Users: `/diataxis/zh/tutorials/first-run/` or `/diataxis/en/tutorials/first-run/`
351363
- Developers: `/diataxis/en/reference/interfaces-and-runtime/` and `/diataxis/en/reference/release-and-governance/`
364+
- Maintainers assessing LFS / desktop bootstrap risk: `/en/sidecar_supply_strategy/` or `/zh/sidecar_supply_strategy/`
365+
- Maintainers comparing mirror cost / user friction / maintenance burden: `/diataxis/en/explanation/sidecar-supply-feasibility/` or `/diataxis/zh/explanation/sidecar-supply-feasibility/`
352366
- CI auto publish workflow (GitHub Pages): `.github/workflows/docs-github-pages-publish.yml`.
353367
- Manual rollback entry: run workflow dispatch and set `git_ref` to a stable tag/commit.
354368
- MkDocs base/path can be overridden by environment variables: `MKDOCS_SITE_URL`, `MKDOCS_BASE_PATH`.
@@ -972,7 +986,7 @@ For optimal performance with "GPU Optimised Rendering", especially on AMD RDNA c
972986
## 中文文档
973987
974988
975-
# 2026-03-31 v1.7.0
989+
# 2026-04-07 v1.7.0
976990
# NoteConnection: 层级知识图谱可视化系统
977991
978992
<img width="606" height="309" alt="banner" src="https://github.com/user-attachments/assets/92e90de5-2b1a-4398-8e8b-6e142c92b6a2" />
@@ -1131,10 +1145,15 @@ NoteConnection 现支持 **两条 Android 生成路径**:
11311145
1. **Capacitor APK 路径**(Web 资产运行时,适合阅读与可视化流程)。
11321146
2. **Tauri Android 路径**(原生壳流程,对齐 `docs/tauri_brainstorming.md`)。
11331147
1148+
与构建/release/运行时边界相关的完整审计文档见:
1149+
1150+
- `docs/en/multi_platform_build_flow_audit.md`
1151+
- `docs/zh/multi_platform_build_flow_audit.md`
1152+
11341153
#### 先决条件
11351154
11361155
- **Node.js** (LTS)
1137-
- **Java JDK** (17 或更高版本)
1156+
- **Java JDK** (21 或更高版本)
11381157
- **Android SDK** (配置在 `ANDROID_HOME` 或通过 Android Studio 安装)
11391158
11401159
#### 方法 A: Capacitor 构建(稳定)
@@ -1189,8 +1208,8 @@ npm run tauri:android:build
11891208
11901209
#### 移动端能力边界
11911210
1192-
- Capacitor 路径当前是 Web 资产打包,不内置桌面端本地 Node sidecar 流程(`/api/build``/api/folders``/api/content`
1193-
- 若需要与 Tauri 架构一致的移动端原生壳路线,请使用 Tauri Android 路径。
1211+
- Capacitor 打包路径本身不内置桌面 Node sidecar,但在具备 Filesystem API 且数据量不超过移动端限制时,Capacitor 原生运行时仍可本地图谱构建
1212+
- 如果需要与 Tauri 架构一致的移动端原生壳能力,请使用 Tauri Android 路径;该路径会通过 Android 原生命令 `build_graph_runtime` 构图
11941213
11951214
---
11961215
@@ -1286,12 +1305,18 @@ max_doc_bytes = 100663296
12861305
12871306
## 🏗️ 构建与部署 (Build & Deployment)
12881307
1289-
对于从源码构建的开发者,NoteConnection 提供两种构建模式
1308+
对于从源码构建的开发者,NoteConnection 现在默认采用 runtime-first 路径
12901309
12911310
- **Electron 桌面构建链路已于 2026-03-01 下线(弃用并完成清退)。**
1292-
1293-
- **Tauri 完整构建** (`npm run tauri:build`): 构建带完整前端资源的桌面安装包。
1294-
- **Tauri 精简构建** (`npm run tauri:build:mini`): 构建排除大型预生成图谱数据的桌面安装包。
1311+
- **Tauri 构建** (`npm run tauri:build`):默认桌面打包路径,采用 runtime-first 资产流,不默认打入预生成图谱载荷。
1312+
- **Tauri 精简构建** (`npm run tauri:build:mini`):与当前默认 runtime-first 打包路径保持兼容的旧别名。
1313+
- **Tauri 完整图谱构建** (`npm run tauri:build:full`):仅在本地存在真实图谱文件时,显式选择把生成型图谱资产打入包中。
1314+
- **Build (`npm run build`)**:默认 runtime-first 前端构建。
1315+
- **完整图谱前端构建** (`npm run build:full`):仅供本地 / demo 场景显式选择预生成图谱资产。
1316+
- **Godot Bootstrap** (`npm run prepare:godot:bin`):可从本地覆盖路径 / 搜索目录 / 缓存 / 固定下载 URL 物化当前主机所需的 Godot sidecar。
1317+
- **桌面 Release Godot 镜像**:release CI 现在会先在项目 GitHub Releases 中维护 Godot 镜像 tag,并以“镜像优先、上游回退”方式下载。
1318+
- **LFS Policy Guard** (`npm run verify:lfs:policy`):在迁移仍保留历史豁免项时,阻止新的 Git LFS 路径再次进入 `src/frontend/``src-tauri/bin/`。未来严格模式可通过 `npm run verify:lfs:policy:strict` 启用。
1319+
- **Sidecar 供给就绪度** (`npm run verify:sidecar:supply`):在继续缩减桌面 sidecar 的 LFS 桥接之前,显式报告当前主机是否已具备离线 bootstrap 能力,还是仍依赖网络。
12951320
- **GPU 开发启动(推荐)** (`npm run tauri:dev:mini:gpu`)。
12961321
- **不要使用** `npm run tauri:dev:mini --gpu`,该写法会被 npm 当作配置参数并触发告警。
12971322
@@ -1308,6 +1333,8 @@ max_doc_bytes = 100663296
13081333
- 推荐查询入口:
13091334
- 用户文档:`/diataxis/zh/tutorials/first-run/``/diataxis/en/tutorials/first-run/`
13101335
- 开发文档:`/diataxis/en/reference/interfaces-and-runtime/``/diataxis/en/reference/release-and-governance/`
1336+
- 维护者评估 LFS / 桌面 bootstrap 风险:`/en/sidecar_supply_strategy/``/zh/sidecar_supply_strategy/`
1337+
- 维护者比较镜像成本 / 用户门槛 / 维护负担:`/diataxis/en/explanation/sidecar-supply-feasibility/``/diataxis/zh/explanation/sidecar-supply-feasibility/`
13111338
- CI 自动发布工作流(GitHub Pages):`.github/workflows/docs-github-pages-publish.yml`
13121339
- 手动回滚入口:运行 workflow_dispatch 并设置 `git_ref` 为稳定 tag/commit。
13131340
- MkDocs base/path 可通过环境变量覆盖:`MKDOCS_SITE_URL``MKDOCS_BASE_PATH`

docs/BILINGUAL_INDEX.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# 2026-03-25 v1.6.0 - Bilingual Docs Pair Index
1+
# 2026-04-07 v1.7.0 - Bilingual Docs Pair Index
22

33
## English Document
44

55
### Scope
66

77
- Canonical pairing index for `docs/en` and `docs/zh`.
8-
- Built from current repository state after `v1.3.0..v1.6.0` doc compare audit.
8+
- Updated against the current repository state after the `v1.7.0` migration-plan doc sync.
99

1010
### Summary
1111

12-
- English files: `19`
13-
- Chinese files: `18`
14-
- Bilingual pairs: `18`
12+
- English files: `22`
13+
- Chinese files: `21`
14+
- Bilingual pairs: `21`
1515
- English-only files: `1`
1616
- Chinese-only files: `0`
1717

@@ -37,6 +37,9 @@
3737
| 16 | `User_Manual.md` | `docs/en/User_Manual.md` | `docs/zh/User_Manual.md` | Paired |
3838
| 17 | `walkthrough.md` | `docs/en/walkthrough.md` | `docs/zh/walkthrough.md` | Paired |
3939
| 18 | `app_config.toml_guide.md` | `docs/en/app_config.toml_guide.md` | `docs/zh/app_config.toml_guide.md` | Paired |
40+
| 19 | `lfs_asset_migration_plan.md` | `docs/en/lfs_asset_migration_plan.md` | `docs/zh/lfs_asset_migration_plan.md` | Paired |
41+
| 20 | `multi_platform_build_flow_audit.md` | `docs/en/multi_platform_build_flow_audit.md` | `docs/zh/multi_platform_build_flow_audit.md` | Paired |
42+
| 21 | `sidecar_supply_strategy.md` | `docs/en/sidecar_supply_strategy.md` | `docs/zh/sidecar_supply_strategy.md` | Paired |
4043

4144
### Unmatched Files
4245

@@ -52,13 +55,13 @@
5255
### 范围
5356

5457
- `docs/en``docs/zh` 的当前双语配对索引。
55-
- 基于 `v1.3.0..v1.6.0` 文档审计后的仓库现状生成
58+
- 已根据 `v1.7.0` 迁移方案文档同步后的仓库现状更新
5659

5760
### 汇总
5861

59-
- 英文文件数:`19`
60-
- 中文文件数:`18`
61-
- 中英配对数:`18`
62+
- 英文文件数:`22`
63+
- 中文文件数:`21`
64+
- 中英配对数:`21`
6265
- 仅英文文件数:`1`
6366
- 仅中文文件数:`0`
6467

@@ -84,6 +87,9 @@
8487
| 16 | `User_Manual.md` | `docs/en/User_Manual.md` | `docs/zh/User_Manual.md` | 已配对 |
8588
| 17 | `walkthrough.md` | `docs/en/walkthrough.md` | `docs/zh/walkthrough.md` | 已配对 |
8689
| 18 | `app_config.toml_guide.md` | `docs/en/app_config.toml_guide.md` | `docs/zh/app_config.toml_guide.md` | 已配对 |
90+
| 19 | `lfs_asset_migration_plan.md` | `docs/en/lfs_asset_migration_plan.md` | `docs/zh/lfs_asset_migration_plan.md` | 已配对 |
91+
| 20 | `multi_platform_build_flow_audit.md` | `docs/en/multi_platform_build_flow_audit.md` | `docs/zh/multi_platform_build_flow_audit.md` | 已配对 |
92+
| 21 | `sidecar_supply_strategy.md` | `docs/en/sidecar_supply_strategy.md` | `docs/zh/sidecar_supply_strategy.md` | 已配对 |
8793

8894
### 未配对文件
8995

0 commit comments

Comments
 (0)