feat: publish HoloLake model-native living system source

This commit is contained in:
冰朔 2026-08-03 10:04:41 +08:00
commit c395dd3a99
2467 changed files with 615073 additions and 0 deletions

View file

@ -32,6 +32,7 @@ Windows / macOS / Linux 构建机与安装包
| 时间 | 版本 | 记录 | 状态 |
| --- | --- | --- | --- |
| 2026-08-03 | 0.4.6 | [星系模型原生活系统与源码归档](operations/2026-08-03-hololake-model-native-living-system-046.md) | 源码已归入 `product-source/hololake-platform/`;等待远端提交回读 |
| 2026-07-30 | 当前本地最新版 | [企业四域真实在线状态、客户端接入与性能核验](operations/2026-07-30-enterprise-presence-and-runtime-audit.md) | 服务器与客户端现状已核验;实现受 CodeScene 访问门禁阻断 |
| 2026-07-30 | 0.4.4 | [Windows 构建节点与安装包交付](operations/2026-07-30-hololake-windows-build-node-044.md) | Windows x64 安装、卸载与图标回读通过;未签名 |
| 2026-07-29 | 0.4.4 | [星系世界、完整知识引擎与 AI Agent 回接](operations/2026-07-29-hololake-galaxy-runtime-044.md) | 本地完整运行时安装并验证 |

View file

@ -0,0 +1,56 @@
---
type: hololake_engineering_delivery
id: HOLOLAKE-MODEL-NATIVE-LIVING-SYSTEM-046
title: HoloLake 0.4.6 星系模型原生活系统与源码归档
status: SOURCE_PUBLICATION_CANDIDATE
updated_at: 2026-08-03T10:05:00+08:00
development_id: DEV-20260801-008
source_baseline: 1cb3950e67c2f3feab65b8932c5cabcc2cafc33a
---
# HoloLake 0.4.6 星系模型原生活系统与源码归档
## 产品方向
HoloLake 是光湖 OS 服务器真实节点、心跳、权限、知识与执行回执的客户端投影。
星系 UI 不是背景图片,也不是传统主题外挂 AI 调色层。系统内部模型只接收点触、
当前系统状态、知识状态、权限边界、责任边界和能力注册,返回受约束的视觉投影、
导航动作、能力调用与回执结构;确定性代码继续负责权限、安全、真实执行与验收。
## 本轮实现
- 将光湖世界、知识库、Agent 工作舱、本地工具与项目接入同一桌面运行时。
- 五域星图使用真实可选择节点、零点原核与权限边界,不把第五域内部系统公开到世界首页。
- 星系场景使用轻量微动、悬停反馈和系统状态驱动的视觉层,保留低性能模式。
- 修复零点原核可见性、Agent 工作舱布局、桌面知识库授权干扰和主题切换入口。
- 增加模型原生活系统的受限规划、校验、确定性执行与回执边界。
- 增加上海实验模型节点配置能力;该节点只提供实验模型/API不承载代码仓库。
- 增加京东代码频道的 HoloLake Router 能力,但仓库发布目标由现行仓库路由决定。
## 验证
- 前端测试4960 项通过。
- Rust 测试1141 项通过。
- Playwright 桌面关键流程26 项通过。
- 源码导入基线:`1cb3950e67c2f3feab65b8932c5cabcc2cafc33a`
- 本仓源码路径:`product-source/hololake-platform/`
上述测试证明本地工程基线,不自动证明服务器部署、人格出生或 App Store 正式发布。
## 路径收口
```text
产品源码、系统架构、工程回执
→ REPO-014 bingshuo/hololake-system-architecture
→ product-source/hololake-platform/
铸渊岗位、开发连续性、维护责任
→ REPO-012 bingshuo/guanghu-ice-heart
→ eternal-lake-heart/heartbeat-core/zhuyuan-persona-system/
旧 REPO-008 bingshuo/hololake-platform
→ HISTORICAL_ROUTE_CLOSED
```
上海实验服务器只承担实验模型/API 节点角色;京东主控代码频道承载上述两个仓库。

22
product-source/README.md Normal file
View file

@ -0,0 +1,22 @@
---
type: Note
status: Active
---
# HoloLake 产品源码
本目录是 HoloLake 产品实现源码的现行公开入口。
- 现行源码:`product-source/hololake-platform/`
- 导入基线:`1cb3950e67c2f3feab65b8932c5cabcc2cafc33a`
- 开发编号:`DEV-20260801-008`
- 责任人格体:铸渊 `ICE-P-ZY001`
- 人类责任人:冰朔 `ICE-GL∞`
`bingshuo/hololake-platform` 已退出这条开发线的发布路由,仅保留为历史仓库。
后续 HoloLake 源码、系统架构和工程回执统一进入
`bingshuo/hololake-system-architecture`,人格职责与连续记忆进入
`bingshuo/guanghu-ice-heart`
本目录不包含构建缓存、`node_modules``target`、覆盖率输出、安装包、令牌或私钥。

View file

@ -0,0 +1,63 @@
# Chunk Sidecar Validation
This repo uses Chunk as an experimental inner-loop validation runner for the same gates enforced by the local git hooks.
## Setup
Install the CLI:
```bash
brew install CircleCI-Public/circleci/chunk
```
If Homebrew cannot install the formula, use the matching archive from the Chunk CLI GitHub releases and place the `chunk` binary on `PATH`.
Authenticate before remote sidecar runs:
```bash
chunk auth set circleci
```
`chunk validate` can run locally without CircleCI auth. Remote sidecars require `CIRCLECI_TOKEN` or stored CircleCI auth.
## Commands
```bash
chunk validate --list
chunk validate lint
chunk validate typecheck
chunk validate frontend-coverage
chunk validate --remote lint
bash .chunk/run-sidecar-gates-local.sh true
```
Use `chunk sidecar setup --name tolaria-hooks` for the first remote environment setup. Once the environment passes, create a snapshot and launch future sidecars from that snapshot to avoid reinstalling Node, Rust, Tauri Linux dependencies, Playwright Chromium, and `cargo-llvm-cov` every time.
Keep native macOS Tauri QA outside Chunk. The sidecar is Linux-based and is meant to catch portable lint, build, unit coverage, Rust, and Playwright smoke failures before the full local pre-push hook runs. Browser provisioning uses `.chunk/install-playwright-browsers.mjs` because Playwright's built-in installer can outlive the current Chunk SSH session while extracting large archives.
## Fast Pre-Push Path
The local pre-push hook prefers the sidecar fast path when Chunk is available. It targets three independent sidecars by name and always passes `--sidecar-id` after resolution, avoiding races with Chunk's global active-sidecar state:
- `tolaria-hooks-frontend-2`: lint and build first, then frontend coverage with `FRONTEND_COVERAGE_SHARDS=2` and `VITEST_COVERAGE_MAX_WORKERS=2`.
- `tolaria-hooks-rust`: clippy, rustfmt, and `cargo llvm-cov` with `CARGO_BUILD_JOBS=2`.
- `tolaria-hooks-playwright`: curated Playwright smoke with one shared Vite server, eight shards, and four concurrent shard workers.
Set `LAPUTA_PREPUSH_LOCAL=1` to force the old local path. Use `SIDECAR_FRONTEND_ID`, `SIDECAR_RUST_ID`, or `SIDECAR_PLAYWRIGHT_ID` to pin a lane to a specific sidecar when duplicate names exist in CircleCI. Use `SIDECAR_SNAPSHOT_ID=<snapshot-id>` when provisioning missing lane sidecars from a prepared snapshot.
The lane launcher uses `chunk sidecar exec` only to start detached remote lane processes with `setsid -f`, then polls status files. Long foreground `exec` commands hit CircleCI's sidecar API deadline; plain background jobs are still tracked by `exec` and can time out.
```bash
bash .chunk/run-sidecar-gates-local.sh true
```
Latest measured passing run with two frontend coverage shards: lane runtime 318s including sync, frontend completed in 313s, and Playwright smoke completed in 104s. The previous single-coverage frontend path took 441s with 457s external wall time, so the two-shard experiment reduced the sidecar long pole by about 29%. A previous Playwright run exposed `tests/smoke/h1-title-decoupled.spec.ts` as flaky on sidecar, so it remains in regression coverage but is no longer part of the curated smoke lane.
To compare the frontend coverage experiment against the old single coverage run, use:
```bash
FRONTEND_COVERAGE_SHARDS=1 bash .chunk/run-sidecar-gates-local.sh false
FRONTEND_COVERAGE_SHARDS=2 bash .chunk/run-sidecar-gates-local.sh false
```
The default sidecar fast path uses two frontend coverage shards. Each shard disables per-shard coverage thresholds, then the merged V8/Istanbul coverage map is checked once against the same 70% line/function/branch/statement thresholds.

View file

@ -0,0 +1,157 @@
{
"commands": [
{
"name": "lint",
"run": "pnpm lint",
"role": "gate",
"fileExt": ".ts,.tsx,.js,.jsx,.mjs,.json",
"timeout": 120,
"limit": 3
},
{
"name": "typecheck",
"run": "npx tsc --noEmit",
"role": "gate",
"fileExt": ".ts,.tsx",
"timeout": 180,
"limit": 3
},
{
"name": "build",
"run": "pnpm build",
"role": "gate",
"fileExt": ".ts,.tsx,.css,.html,.json",
"timeout": 300,
"limit": 2
},
{
"name": "frontend-coverage",
"run": "pnpm test:coverage --silent",
"role": "gate",
"fileExt": ".ts,.tsx",
"timeout": 600,
"limit": 2
},
{
"name": "rust-lint",
"run": "cargo clippy --manifest-path=src-tauri/Cargo.toml -- -D warnings && cargo fmt --manifest-path=src-tauri/Cargo.toml -- --check",
"role": "gate",
"fileExt": ".rs",
"timeout": 300,
"limit": 2
},
{
"name": "rust-coverage",
"run": "cargo llvm-cov --manifest-path src-tauri/Cargo.toml --no-clean --ignore-filename-regex \"lib\\.rs|main\\.rs|menu\\.rs\" --fail-under-lines 85 -- --test-threads=1",
"role": "gate",
"fileExt": ".rs",
"timeout": 900,
"limit": 1
},
{
"name": "smoke-1",
"run": "bash .chunk/run-playwright-smoke.sh 1/8",
"role": "gate",
"fileExt": ".ts,.tsx",
"timeout": 240,
"limit": 1
},
{
"name": "smoke-2",
"run": "bash .chunk/run-playwright-smoke.sh 2/8",
"role": "gate",
"fileExt": ".ts,.tsx",
"timeout": 240,
"limit": 1
},
{
"name": "smoke-3",
"run": "bash .chunk/run-playwright-smoke.sh 3/8",
"role": "gate",
"fileExt": ".ts,.tsx",
"timeout": 240,
"limit": 1
},
{
"name": "smoke-4",
"run": "bash .chunk/run-playwright-smoke.sh 4/8",
"role": "gate",
"fileExt": ".ts,.tsx",
"timeout": 240,
"limit": 1
},
{
"name": "smoke-5",
"run": "bash .chunk/run-playwright-smoke.sh 5/8",
"role": "gate",
"fileExt": ".ts,.tsx",
"timeout": 240,
"limit": 1
},
{
"name": "smoke-6",
"run": "bash .chunk/run-playwright-smoke.sh 6/8",
"role": "gate",
"fileExt": ".ts,.tsx",
"timeout": 240,
"limit": 1
},
{
"name": "smoke-7",
"run": "bash .chunk/run-playwright-smoke.sh 7/8",
"role": "gate",
"fileExt": ".ts,.tsx",
"timeout": 240,
"limit": 1
},
{
"name": "smoke-8",
"run": "bash .chunk/run-playwright-smoke.sh 8/8",
"role": "gate",
"fileExt": ".ts,.tsx",
"timeout": 240,
"limit": 1
}
],
"stopHookMaxAttempts": 2,
"vcs": {
"org": "refactoringhq",
"repo": "tolaria"
},
"orgID": "39f93336-5295-4c6c-845f-e692c1d3f968",
"environment": {
"stack": "javascript-rust-tauri",
"setup": [
{
"name": "system",
"command": "sudo apt-get update && sudo apt-get install -y --no-install-recommends build-essential curl file git libwebkit2gtk-4.1-dev libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev libsoup-3.0-dev patchelf pkg-config unzip wget xvfb && sudo rm -rf /var/lib/apt/lists/*"
},
{
"name": "rust",
"command": "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal && . \"$HOME/.cargo/env\" && rustup default stable && rustup component add clippy rustfmt && cargo install cargo-llvm-cov --locked"
},
{
"name": "node",
"command": "curl -fsSL https://nodejs.org/dist/v26.3.0/node-v26.3.0-linux-x64.tar.xz | sudo tar -xJ -C /usr/local --strip-components=1 && node --version && npm --version"
},
{
"name": "pnpm",
"command": "sudo npm install -g pnpm@10.33.0 && pnpm --version"
},
{
"name": "install",
"command": "mkdir -p \"$HOME/Documents\" && pnpm install --frozen-lockfile && . \"$HOME/.cargo/env\" && cargo fetch --manifest-path src-tauri/Cargo.toml"
},
{
"name": "playwright-deps",
"command": "pnpm exec playwright install-deps chromium"
},
{
"name": "playwright",
"command": "node .chunk/install-playwright-browsers.mjs"
}
],
"image": "cimg/node",
"image_version": "26.3.0"
}
}

View file

@ -0,0 +1,100 @@
#!/usr/bin/env node
/* global console */
import { execFileSync, spawnSync } from 'node:child_process'
import {
existsSync,
mkdirSync,
readdirSync,
renameSync,
rmSync,
writeFileSync,
} from 'node:fs'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
function run(command, args) {
const result = spawnSync(command, args, { stdio: 'inherit' })
if (result.error) throw result.error
if (result.status !== 0) {
throw new Error(`${command} exited with status ${result.status}`)
}
}
function parsePlan(planText) {
const entries = []
const seen = new Set()
for (const section of planText.split(/\n(?=\S)/)) {
const label = section.split('\n')[0]?.trim() ?? ''
const location = readField(section, 'Install location')
const url = readField(section, 'Download url')
rememberEntry(entries, seen, { label, location, url })
}
return entries
}
function readField(text, name) {
const match = text.match(new RegExp(`^\\s*${name}:\\s*(.+)$`, 'm'))
return match?.[1].trim() ?? ''
}
function rememberEntry(entries, seen, entry) {
const key = `${entry.location}\n${entry.url}`
if (!entry.location || !entry.url || seen.has(key)) return
seen.add(key)
entries.push(entry)
}
function installBrowser(entry) {
const markerPath = join(entry.location, 'INSTALLATION_COMPLETE')
if (existsSync(markerPath)) {
console.log(`Already installed: ${entry.label}`)
return
}
const workDir = join(tmpdir(), `playwright-${Date.now()}`)
const archivePath = join(workDir, 'browser.zip')
const extractDir = join(workDir, 'extract')
rmSync(entry.location, { force: true, recursive: true })
mkdirSync(extractDir, { recursive: true })
console.log(`Downloading ${entry.label}`)
run('curl', [
'-fL',
'--retry',
'3',
'--connect-timeout',
'20',
'-o',
archivePath,
entry.url,
])
console.log(`Extracting ${entry.label}`)
run('unzip', ['-q', archivePath, '-d', extractDir])
mkdirSync(entry.location, { recursive: true })
for (const child of readdirSync(extractDir)) {
renameSync(join(extractDir, child), join(entry.location, child))
}
writeFileSync(markerPath, '')
rmSync(workDir, { force: true, recursive: true })
}
const planText = execFileSync(
'npx',
['playwright', 'install', '--dry-run', 'chromium'],
{ encoding: 'utf8' },
)
const entries = parsePlan(planText)
if (entries.length === 0) {
throw new Error('Playwright did not report any browser archives to install')
}
for (const entry of entries) {
installBrowser(entry)
}

View file

@ -0,0 +1,146 @@
#!/usr/bin/env bash
set -euo pipefail
total_shards="${1:-${PLAYWRIGHT_SHARDS:-8}}"
concurrency="${PLAYWRIGHT_CONCURRENCY:-$total_shards}"
log_dir="${TMPDIR:-/tmp}/tolaria-playwright-shards-$$"
batch_pids=()
shared_server="${PLAYWRIGHT_SHARED_SERVER:-1}"
server_port="${PLAYWRIGHT_SMOKE_PORT:-41741}"
base_url="${BASE_URL:-http://127.0.0.1:${server_port}}"
server_port="$(node -e 'console.log(new URL(process.argv[1]).port || "41741")' "$base_url")"
server_pid=""
if [[ ! "$total_shards" =~ ^[1-9][0-9]*$ ]]; then
printf 'Usage: %s [total-shards]\n' "$0" >&2
exit 2
fi
if [[ ! "$concurrency" =~ ^[1-9][0-9]*$ ]]; then
printf 'PLAYWRIGHT_CONCURRENCY must be a positive integer\n' >&2
exit 2
fi
mkdir -p "$log_dir"
stop_shared_server() {
if [[ -z "$server_pid" ]]; then
return
fi
kill -TERM "$server_pid" 2>/dev/null || true
sleep 2
kill -KILL "$server_pid" 2>/dev/null || true
server_pid=""
}
cleanup() {
local status=$?
trap - EXIT INT TERM
for pid in "${batch_pids[@]:-}"; do
kill -TERM "$pid" 2>/dev/null || true
done
sleep 2
for pid in "${batch_pids[@]:-}"; do
kill -KILL "$pid" 2>/dev/null || true
done
stop_shared_server
exit "$status"
}
trap cleanup EXIT INT TERM
wait_for_shared_server() {
local deadline=$((SECONDS + 30))
until curl -fsS "$base_url" >/dev/null 2>&1; do
if [[ -n "$server_pid" ]] && ! kill -0 "$server_pid" 2>/dev/null; then
printf '[chunk-playwright] shared server exited before becoming ready\n' >&2
sed 's/^/[shared-server] /' "${log_dir}/shared-server.log" >&2 || true
return 1
fi
if [[ "$SECONDS" -ge "$deadline" ]]; then
printf '[chunk-playwright] shared server did not become ready at %s\n' "$base_url" >&2
sed 's/^/[shared-server] /' "${log_dir}/shared-server.log" >&2 || true
return 1
fi
sleep 1
done
}
start_shared_server() {
if [[ "$shared_server" != "1" ]]; then
return
fi
printf '[chunk-playwright] starting shared server at %s\n' "$base_url"
TOLARIA_VITE_CACHE_DIR="${TOLARIA_VITE_CACHE_DIR:-${TMPDIR:-/tmp}/tolaria-vite-smoke-shared}" \
node scripts/playwright-smoke-server.mjs "$server_port" >"${log_dir}/shared-server.log" 2>&1 &
server_pid="$!"
wait_for_shared_server
}
run_batch() {
local first_shard="$1"
local failures=0
local names=()
local shard="$first_shard"
batch_pids=()
while [[ "$shard" -le "$total_shards" && "${#batch_pids[@]}" -lt "$concurrency" ]]; do
local name="smoke-${shard}-${total_shards}"
local log_file="${log_dir}/${name}.log"
printf '[chunk-playwright] starting %s\n' "$name"
if [[ "$shared_server" == "1" ]]; then
BASE_URL="$base_url" PLAYWRIGHT_REUSE_SERVER=1 PLAYWRIGHT_SMOKE_PORT="$server_port" \
bash .chunk/run-playwright-smoke.sh "${shard}/${total_shards}" >"$log_file" 2>&1 &
else
bash .chunk/run-playwright-smoke.sh "${shard}/${total_shards}" >"$log_file" 2>&1 &
fi
batch_pids+=("$!")
names+=("$name")
shard=$((shard + 1))
done
for index in "${!batch_pids[@]}"; do
local pid="${batch_pids[$index]}"
local name="${names[$index]}"
local log_file="${log_dir}/${name}.log"
if wait "$pid"; then
printf '[chunk-playwright] %s passed\n' "$name"
else
failures=1
printf '[chunk-playwright] %s failed\n' "$name"
fi
sed "s/^/[${name}] /" "$log_file"
done
batch_pids=()
return "$failures"
}
next_shard=1
failed=0
start_shared_server
while [[ "$next_shard" -le "$total_shards" ]]; do
if ! run_batch "$next_shard"; then
failed=1
fi
next_shard=$((next_shard + concurrency))
done
stop_shared_server
exit "$failed"

View file

@ -0,0 +1,94 @@
#!/usr/bin/env bash
set -euo pipefail
shard="${1:-}"
shard_label="all"
base_url="${BASE_URL:-}"
port="${PLAYWRIGHT_SMOKE_PORT:-41741}"
if [[ -n "$shard" ]]; then
if [[ ! "$shard" =~ ^[1-9][0-9]*/[1-9][0-9]*$ ]]; then
printf 'Usage: %s [shard/total]\n' "$0" >&2
exit 2
fi
shard_index="${shard%%/*}"
shard_label="${shard//\//-}"
if [[ -z "$base_url" ]]; then
port=$((41740 + shard_index))
fi
fi
base_url="${base_url:-http://127.0.0.1:${port}}"
port="$(node -e 'console.log(new URL(process.argv[1]).port || "41741")' "$base_url")"
log_file="${TMPDIR:-/tmp}/tolaria-playwright-smoke-${shard_label}.log"
playwright_pid=""
cleanup() {
local status=$?
if [[ -n "$playwright_pid" ]]; then
kill -TERM "$playwright_pid" 2>/dev/null || true
sleep 2
kill -KILL "$playwright_pid" 2>/dev/null || true
fi
if [[ "${PLAYWRIGHT_REUSE_SERVER:-}" != "1" ]]; then
pkill -TERM -f "playwright-smoke-server.mjs ${port}" 2>/dev/null || true
pkill -TERM -f "vite.js --host 127.0.0.1 --port ${port}" 2>/dev/null || true
fi
exit "$status"
}
trap cleanup INT TERM
mapfile -t smoke_files < <(node <<'NODE'
const fs = require('node:fs')
const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'))
const script = packageJson.scripts && packageJson.scripts['playwright:smoke']
const prefix = 'playwright test --config playwright.smoke.config.ts '
if (!script || !script.startsWith(prefix)) {
throw new Error('Unexpected playwright:smoke script format')
}
for (const file of script.slice(prefix.length).trim().split(/\s+/)) {
if (file) {
console.log(file)
}
}
NODE
)
: > "$log_file"
playwright_args=(
test
--config playwright.smoke.config.ts
"${smoke_files[@]}"
--reporter=line
)
if [[ -n "$shard" ]]; then
playwright_args+=(--shard "$shard")
fi
printf '[chunk-playwright] running %s curated smoke files on port %s' "${#smoke_files[@]}" "$port"
if [[ -n "$shard" ]]; then
printf ' with shard %s' "$shard"
fi
printf '\n'
set +e
env CI=true BASE_URL="$base_url" PLAYWRIGHT_REUSE_SERVER="${PLAYWRIGHT_REUSE_SERVER:-}" pnpm exec playwright "${playwright_args[@]}" \
> >(tee "$log_file") 2>&1 &
playwright_pid=$!
wait "$playwright_pid"
playwright_status=$?
playwright_pid=""
set -e
printf '[chunk-playwright] smoke %s exited with status %s\n' "$shard_label" "$playwright_status"
exit "$playwright_status"

View file

@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -euo pipefail
start_time=$(date +%s)
log_rust() {
printf '[sidecar-rust +%ss] %s\n' "$(($(date +%s) - start_time))" "$*"
}
mkdir -p "$HOME/Documents"
# shellcheck disable=SC1091
. "$HOME/.cargo/env"
export CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-2}"
log_rust 'clippy started'
cargo clippy --manifest-path=src-tauri/Cargo.toml -- -D warnings
log_rust 'clippy passed'
log_rust 'rustfmt started'
cargo fmt --manifest-path=src-tauri/Cargo.toml -- --check
log_rust 'rustfmt passed'
log_rust 'coverage started'
cargo llvm-cov \
--manifest-path src-tauri/Cargo.toml \
--no-clean \
--ignore-filename-regex "lib\\.rs|main\\.rs|menu\\.rs" \
--fail-under-lines 85 \
-- --test-threads=1
log_rust "completed in $(($(date +%s) - start_time))s"

View file

@ -0,0 +1,395 @@
#!/usr/bin/env bash
set -euo pipefail
readonly unavailable_status=86
rust_changed="${1:-true}"
playwright_shards="${PLAYWRIGHT_SHARDS:-8}"
playwright_concurrency="${PLAYWRIGHT_CONCURRENCY:-4}"
playwright_shared_server="${PLAYWRIGHT_SHARED_SERVER:-1}"
vitest_coverage_max_workers="${VITEST_COVERAGE_MAX_WORKERS:-${SIDECAR_VITEST_MAX_WORKERS:-2}}"
frontend_coverage_shards="${FRONTEND_COVERAGE_SHARDS:-${SIDECAR_FRONTEND_COVERAGE_SHARDS:-2}}"
cargo_build_jobs="${CARGO_BUILD_JOBS:-2}"
timeout_seconds="${SIDECAR_GATE_TIMEOUT:-1800}"
poll_interval="${SIDECAR_GATE_POLL_INTERVAL:-20}"
launch_timeout="${SIDECAR_GATE_LAUNCH_TIMEOUT:-45}"
launch_attempts="${SIDECAR_GATE_LAUNCH_ATTEMPTS:-3}"
remote_workdir="${SIDECAR_REMOTE_WORKDIR:-/home/user/tolaria}"
sidecar_prefix="${SIDECAR_NAME_PREFIX:-tolaria-hooks}"
frontend_name="${SIDECAR_FRONTEND_NAME:-${sidecar_prefix}-frontend-2}"
rust_name="${SIDECAR_RUST_NAME:-${sidecar_prefix}-rust}"
playwright_name="${SIDECAR_PLAYWRIGHT_NAME:-${sidecar_prefix}-playwright}"
state_dir="$(mktemp -d "${TMPDIR:-/tmp}/tolaria-sidecar-lanes.XXXXXX")"
lanes_file="${state_dir}/lanes.tsv"
: > "$lanes_file"
cleanup_state() {
rm -rf "$state_dir"
}
trap cleanup_state EXIT
resolve_chunk_bin() {
if [[ -n "${CHUNK_BIN:-}" && -x "$CHUNK_BIN" ]]; then
return 0
fi
if command -v chunk >/dev/null 2>&1; then
CHUNK_BIN="$(command -v chunk)"
return 0
fi
if [[ -x "$HOME/.local/bin/chunk" ]]; then
CHUNK_BIN="$HOME/.local/bin/chunk"
return 0
fi
return 1
}
load_org_id() {
if [[ -n "${CIRCLECI_ORG_ID:-}" ]]; then
printf '%s\n' "$CIRCLECI_ORG_ID"
return
fi
node -e "const fs=require('node:fs'); const c=JSON.parse(fs.readFileSync('.chunk/config.json','utf8')); if (c.orgID) process.stdout.write(c.orgID)"
}
sidecar_id_by_name() {
local name="$1"
"$CHUNK_BIN" sidecar list 2>/dev/null | awk -v name="$name" '$1 == name { print $2; found=1; exit } END { exit found ? 0 : 1 }'
}
create_sidecar_from_snapshot() {
local name="$1"
if [[ -z "${SIDECAR_SNAPSHOT_ID:-}" ]]; then
return 1
fi
echo " -> Creating ${name} from snapshot ${SIDECAR_SNAPSHOT_ID}" >&2
"$CHUNK_BIN" sidecar create --name "$name" --org-id "$org_id" --image "$SIDECAR_SNAPSHOT_ID" >/dev/null
}
ensure_sidecar() {
local name="$1"
local explicit_id="${2:-}"
local id
if [[ -n "$explicit_id" ]]; then
printf '%s\n' "$explicit_id"
return 0
fi
if id="$(sidecar_id_by_name "$name")"; then
printf '%s\n' "$id"
return 0
fi
echo " -> Sidecar ${name} not found; provisioning it..." >&2
if ! create_sidecar_from_snapshot "$name"; then
"$CHUNK_BIN" sidecar setup --name "$name" --org-id "$org_id" >/dev/null
fi
sidecar_id_by_name "$name"
}
sync_lane() {
local lane="$1"
local sidecar_id="$2"
local log_file="${state_dir}/sync-${lane}.log"
{
echo "[sidecar-sync] ${lane}: syncing to ${sidecar_id}"
if "$CHUNK_BIN" sidecar sync --sidecar-id "$sidecar_id" --workdir "$remote_workdir"; then
exit 0
fi
echo "[sidecar-sync] ${lane}: sync failed, rerunning setup once"
"$CHUNK_BIN" sidecar setup --sidecar-id "$sidecar_id" --dir .
"$CHUNK_BIN" sidecar sync --sidecar-id "$sidecar_id" --workdir "$remote_workdir"
} >"$log_file" 2>&1
}
sync_all_lanes() {
local failures=0
local frontend_pid rust_pid playwright_pid
sync_lane frontend "$frontend_id" &
frontend_pid=$!
sync_lane rust "$rust_id" &
rust_pid=$!
sync_lane playwright "$playwright_id" &
playwright_pid=$!
for lane_pid in "$frontend_pid" "$rust_pid" "$playwright_pid"; do
if ! wait "$lane_pid"; then
failures=1
fi
done
if [[ "$failures" != "0" ]]; then
echo "Chunk sidecar sync failed"
sed 's/^/ /' "${state_dir}"/sync-*.log 2>/dev/null || true
return 1
fi
}
record_lane() {
local lane="$1"
local sidecar_id="$2"
local status_file="$3"
local log_file="$4"
local pid_file="$5"
printf '%s\t%s\t%s\t%s\t%s\n' "$lane" "$sidecar_id" "$status_file" "$log_file" "$pid_file" >> "$lanes_file"
}
launch_lane() {
local lane="$1"
local sidecar_id="$2"
local run_id="tolaria-${lane}-$(date +%s)-$$"
local remote_status="/tmp/${run_id}.status"
local remote_log="/tmp/${run_id}.log"
local remote_pid="/tmp/${run_id}.pid"
local remote_launcher="/tmp/${run_id}.launcher.log"
local launch_output_file="${state_dir}/launch-${lane}.log"
local launch_attempt=1
while [[ "$launch_attempt" -le "$launch_attempts" ]]; do
local launch_status=0
local launch_pid
local launch_elapsed=0
echo " -> Launching ${lane} on ${sidecar_id} (attempt ${launch_attempt}/${launch_attempts})"
"$CHUNK_BIN" sidecar exec \
--sidecar-id "$sidecar_id" \
--command bash \
--args -lc \
--args "cd '$remote_workdir' && export RUST_CHANGED='$rust_changed' PLAYWRIGHT_SHARDS='$playwright_shards' PLAYWRIGHT_CONCURRENCY='$playwright_concurrency' PLAYWRIGHT_SHARED_SERVER='$playwright_shared_server' VITEST_COVERAGE_MAX_WORKERS='$vitest_coverage_max_workers' FRONTEND_COVERAGE_SHARDS='$frontend_coverage_shards' CARGO_BUILD_JOBS='$cargo_build_jobs' && rm -f '$remote_status' '$remote_log' '$remote_pid' '$remote_launcher' && nohup setsid -f bash -lc 'bash .chunk/run-sidecar-lane.sh $lane >\"$remote_log\" 2>&1; printf \"%s\\n\" \"\$?\" >\"$remote_status\"' </dev/null >'$remote_launcher' 2>&1" \
>"$launch_output_file" 2>&1 &
launch_pid=$!
while kill -0 "$launch_pid" 2>/dev/null; do
if [[ "$launch_elapsed" -ge "$launch_timeout" ]]; then
launch_status=124
kill "$launch_pid" 2>/dev/null || true
sleep 1
kill -KILL "$launch_pid" 2>/dev/null || true
wait "$launch_pid" 2>/dev/null || true
break
fi
sleep 1
launch_elapsed=$((launch_elapsed + 1))
done
if [[ "$launch_status" == "0" ]]; then
wait "$launch_pid" || launch_status=$?
fi
if [[ "$launch_status" == "0" ]]; then
record_lane "$lane" "$sidecar_id" "$remote_status" "$remote_log" "$remote_pid"
return 0
fi
cat "$launch_output_file"
if launch_state="$(poll_lane_status "$sidecar_id" "$remote_status" "$remote_log" "$remote_pid" 2>/dev/null)"; then
launch_state="$(printf '%s\n' "$launch_state" | tail -1 | tr -d '[:space:]')"
if [[ "$launch_state" == "running" || "$launch_state" == "0" || "$launch_state" =~ ^[1-9][0-9]*$ ]]; then
echo " -> ${lane} appears to have started despite launch status ${launch_status}"
record_lane "$lane" "$sidecar_id" "$remote_status" "$remote_log" "$remote_pid"
return 0
fi
fi
echo "Chunk sidecar launch failed for ${lane} with status ${launch_status}"
if [[ "$launch_attempt" -lt "$launch_attempts" ]]; then
sleep 5
fi
launch_attempt=$((launch_attempt + 1))
done
return 1
}
fetch_remote_log_tail() {
local lane="$1"
local sidecar_id="$2"
local log_file="$3"
echo ""
echo "----- ${lane} log tail -----"
"$CHUNK_BIN" sidecar exec \
--sidecar-id "$sidecar_id" \
--command bash \
--args -lc \
--args "tail -180 '$log_file' 2>/dev/null || true" 2>&1 || true
}
stop_lane() {
local sidecar_id="$1"
local pid_file="$2"
local log_file="$3"
"$CHUNK_BIN" sidecar exec \
--sidecar-id "$sidecar_id" \
--command bash \
--args -lc \
--args "if [ -s '$pid_file' ]; then pid=\$(cat '$pid_file'); kill -TERM -\"\$pid\" 2>/dev/null || kill -TERM \"\$pid\" 2>/dev/null || true; sleep 3; kill -KILL -\"\$pid\" 2>/dev/null || kill -KILL \"\$pid\" 2>/dev/null || true; fi; ps -eo pid=,command= | awk -v target='$log_file' '\$0 ~ target && \$0 !~ /awk/ { print \$1 }' | xargs -r kill -TERM 2>/dev/null || true" \
>/dev/null 2>&1 || true
}
stop_all_lanes() {
while IFS=$'\t' read -r _lane sidecar_id _status_file log_file pid_file; do
stop_lane "$sidecar_id" "$pid_file" "$log_file"
done < "$lanes_file"
}
poll_lane_status() {
local sidecar_id="$1"
local status_file="$2"
local log_file="$3"
local pid_file="$4"
"$CHUNK_BIN" sidecar exec \
--sidecar-id "$sidecar_id" \
--command bash \
--args -lc \
--args "if [ -f '$status_file' ]; then cat '$status_file'; elif test -s '$pid_file' && kill -0 \"\$(cat '$pid_file')\" 2>/dev/null; then echo running; elif ps -eo pid=,command= | awk -v target='$log_file' '\$0 ~ target && \$0 !~ /awk/ { found=1 } END { exit found ? 0 : 1 }'; then echo running; else echo missing; fi" 2>&1
}
poll_lanes() {
local started_at="$1"
local last_heartbeat=0
local completed_file="${state_dir}/completed"
local failed=0
: > "$completed_file"
while true; do
local all_done=1
while IFS=$'\t' read -r lane sidecar_id status_file log_file pid_file; do
if grep -qx "$lane" "$completed_file"; then
continue
fi
local poll_status=0
local poll_output
local status
poll_output="$(poll_lane_status "$sidecar_id" "$status_file" "$log_file" "$pid_file")" || poll_status=$?
if [[ "$poll_status" != "0" ]]; then
echo " -> ${lane} status poll failed: $(printf '%s\n' "$poll_output" | head -1)"
all_done=0
continue
fi
status="$(printf '%s\n' "$poll_output" | tail -1 | tr -d '[:space:]')"
case "$status" in
0)
echo "$lane" >> "$completed_file"
echo " -> ${lane} passed"
fetch_remote_log_tail "$lane" "$sidecar_id" "$log_file"
;;
running|"")
all_done=0
;;
missing)
echo " -> ${lane} stopped before writing a status file"
fetch_remote_log_tail "$lane" "$sidecar_id" "$log_file"
failed=1
echo "$lane" >> "$completed_file"
;;
*)
echo " -> ${lane} failed with status ${status}"
fetch_remote_log_tail "$lane" "$sidecar_id" "$log_file"
failed=1
echo "$lane" >> "$completed_file"
;;
esac
done < "$lanes_file"
if [[ "$failed" != "0" ]]; then
stop_all_lanes
return 1
fi
if [[ "$all_done" == "1" ]]; then
return 0
fi
local elapsed
elapsed=$(($(date +%s) - started_at))
if [[ "$elapsed" -ge "$timeout_seconds" ]]; then
echo "Chunk sidecar lanes timed out after ${elapsed}s"
stop_all_lanes
return 124
fi
if [[ $((elapsed - last_heartbeat)) -ge 60 ]]; then
echo " -> Sidecar lanes still running (${elapsed}s elapsed)"
last_heartbeat="$elapsed"
fi
sleep "$poll_interval"
done
}
if ! resolve_chunk_bin; then
echo "Chunk CLI not found"
exit "$unavailable_status"
fi
org_id="$(load_org_id)"
if [[ -z "$org_id" ]]; then
echo "Chunk org id not found"
exit "$unavailable_status"
fi
echo "Chunk sidecar lanes:"
echo " frontend: ${frontend_name}"
echo " rust: ${rust_name}"
echo " playwright: ${playwright_name}"
if [[ -n "${SIDECAR_FRONTEND_ID:-}${SIDECAR_RUST_ID:-}${SIDECAR_PLAYWRIGHT_ID:-}" ]]; then
echo " explicit sidecar IDs are set for one or more lanes"
fi
echo " vitest workers=${vitest_coverage_max_workers}; frontend coverage shards=${frontend_coverage_shards}; playwright shards=${playwright_shards}; concurrency=${playwright_concurrency}; cargo jobs=${cargo_build_jobs}"
if ! frontend_id="$(ensure_sidecar "$frontend_name" "${SIDECAR_FRONTEND_ID:-}")"; then
echo "Chunk frontend sidecar unavailable"
exit "$unavailable_status"
fi
if ! rust_id="$(ensure_sidecar "$rust_name" "${SIDECAR_RUST_ID:-}")"; then
echo "Chunk rust sidecar unavailable"
exit "$unavailable_status"
fi
if ! playwright_id="$(ensure_sidecar "$playwright_name" "${SIDECAR_PLAYWRIGHT_ID:-}")"; then
echo "Chunk Playwright sidecar unavailable"
exit "$unavailable_status"
fi
echo "Syncing worktree to sidecar lanes..."
if ! sync_all_lanes; then
exit "$unavailable_status"
fi
started_at=$(date +%s)
echo "Launching sidecar lanes..."
launch_lane frontend "$frontend_id"
if [[ "$rust_changed" == "true" ]]; then
launch_lane rust "$rust_id"
else
echo " -> Rust lane skipped because RUST_CHANGED=false"
fi
launch_lane playwright "$playwright_id"
if ! poll_lanes "$started_at"; then
exit 1
fi
elapsed=$(($(date +%s) - started_at))
echo "Chunk sidecar lanes passed in ${elapsed}s"
exit 0

View file

@ -0,0 +1,115 @@
#!/usr/bin/env bash
set -euo pipefail
start_time=$(date +%s)
log_dir="${TMPDIR:-/tmp}/tolaria-sidecar-gates-$$"
rust_changed="${RUST_CHANGED:-true}"
rust_phase="${SIDECAR_RUST_PHASE:-after-coverage}"
playwright_phase="${SIDECAR_PLAYWRIGHT_PHASE:-after}"
playwright_shards="${PLAYWRIGHT_SHARDS:-8}"
mkdir -p "$log_dir"
if [[ -z "${VITEST_COVERAGE_MAX_WORKERS:-}" ]]; then
if [[ "$playwright_phase" == "early" ]]; then
export VITEST_COVERAGE_MAX_WORKERS="${SIDECAR_EARLY_VITEST_MAX_WORKERS:-2}"
else
export VITEST_COVERAGE_MAX_WORKERS="${SIDECAR_VITEST_MAX_WORKERS:-3}"
fi
fi
elapsed_seconds() {
printf '%s' "$(($(date +%s) - start_time))"
}
log_gate() {
printf '[sidecar-gates +%ss] %s\n' "$(elapsed_seconds)" "$*"
}
run_job() {
local name="$1"
shift
local log_file="${log_dir}/${name}.log"
(
set +e
log_gate "${name} started"
"$@" 2>&1 | tee "$log_file"
local status=${PIPESTATUS[0]}
log_gate "${name} exited with status ${status}"
exit "$status"
) &
printf '%s:%s\n' "$name" "$!" >> "$jobs_file"
}
terminate_jobs() {
local pids
pids="$(jobs -pr || true)"
if [[ -n "$pids" ]]; then
kill $pids 2>/dev/null || true
sleep 2
kill -KILL $pids 2>/dev/null || true
fi
}
jobs_file="${log_dir}/jobs"
: > "$jobs_file"
trap terminate_jobs INT TERM
wait_for_jobs() {
local failures=0
while IFS=: read -r name pid; do
if wait "$pid"; then
printf '[sidecar-gates] %s passed\n' "$name"
else
failures=1
printf '[sidecar-gates] %s failed\n' "$name"
fi
done < "$jobs_file"
return "$failures"
}
log_gate "rust phase=${rust_phase}; playwright phase=${playwright_phase}; shards=${playwright_shards}; concurrency=${PLAYWRIGHT_CONCURRENCY:-${playwright_shards}}; vitest workers=${VITEST_COVERAGE_MAX_WORKERS:-4}"
run_job frontend-lint pnpm lint
run_job frontend-build pnpm build
run_job frontend-coverage pnpm test:coverage --silent
if [[ "$rust_changed" == "true" && "$rust_phase" == "early" ]]; then
run_job rust bash .chunk/run-rust-gate.sh
elif [[ "$rust_changed" != "true" ]]; then
log_gate 'rust skipped because RUST_CHANGED=false'
fi
if [[ "$playwright_phase" == "early" ]]; then
run_job playwright-smoke bash .chunk/run-playwright-shards.sh "$playwright_shards"
fi
if ! wait_for_jobs; then
if [[ "$playwright_phase" == "early" ]]; then
log_gate 'one or more sidecar gates failed'
else
log_gate 'stopping before Playwright because a prerequisite gate failed'
fi
exit 1
fi
if [[ "$playwright_phase" != "early" || ( "$rust_changed" == "true" && "$rust_phase" != "early" ) ]]; then
: > "$jobs_file"
if [[ "$rust_changed" == "true" && "$rust_phase" != "early" ]]; then
run_job rust bash .chunk/run-rust-gate.sh
fi
if [[ "$playwright_phase" != "early" ]]; then
run_job playwright-smoke bash .chunk/run-playwright-shards.sh "$playwright_shards"
fi
if ! wait_for_jobs; then
exit 1
fi
fi
log_gate "completed in $(elapsed_seconds)s"
exit 0

View file

@ -0,0 +1,136 @@
#!/usr/bin/env bash
set -euo pipefail
lane="${1:-}"
start_time=$(date +%s)
elapsed_seconds() {
printf '%s' "$(($(date +%s) - start_time))"
}
log_lane() {
printf '[sidecar-%s +%ss] %s\n' "$lane" "$(elapsed_seconds)" "$*"
}
run_job() {
local name="$1"
shift
local log_file="${log_dir}/${name}.log"
(
set +e
log_lane "${name} started"
"$@" 2>&1 | tee "$log_file"
local status=${PIPESTATUS[0]}
log_lane "${name} exited with status ${status}"
exit "$status"
) &
printf '%s:%s\n' "$name" "$!" >> "$jobs_file"
}
sync_node_dependencies() {
log_lane "syncing pnpm dependencies with lockfile"
pnpm install --frozen-lockfile
}
terminate_jobs() {
local pids
pids="$(jobs -pr || true)"
if [[ -n "$pids" ]]; then
kill $pids 2>/dev/null || true
sleep 2
kill -KILL $pids 2>/dev/null || true
fi
}
wait_for_jobs() {
local failures=0
while IFS=: read -r name pid; do
if wait "$pid"; then
printf '[sidecar-%s] %s passed\n' "$lane" "$name"
else
failures=1
printf '[sidecar-%s] %s failed\n' "$lane" "$name"
fi
done < "$jobs_file"
return "$failures"
}
run_frontend_coverage_job() {
local shard_count="${FRONTEND_COVERAGE_SHARDS:-1}"
if [[ ! "$shard_count" =~ ^[1-9][0-9]*$ ]]; then
printf 'FRONTEND_COVERAGE_SHARDS must be a positive integer\n' >&2
return 2
fi
if [[ "$shard_count" == "1" ]]; then
run_job frontend-coverage pnpm test:coverage --silent
return
fi
run_job frontend-coverage node scripts/run-vitest-coverage-shards.mjs --silent
}
run_frontend_lane() {
log_dir="${TMPDIR:-/tmp}/tolaria-sidecar-frontend-$$"
jobs_file="${log_dir}/jobs"
mkdir -p "$log_dir"
: > "$jobs_file"
trap terminate_jobs INT TERM
sync_node_dependencies
export VITEST_COVERAGE_MAX_WORKERS="${VITEST_COVERAGE_MAX_WORKERS:-2}"
log_lane "vitest workers=${VITEST_COVERAGE_MAX_WORKERS}; coverage shards=${FRONTEND_COVERAGE_SHARDS:-1}"
run_job frontend-lint pnpm lint
run_job frontend-build pnpm build
if ! wait_for_jobs; then
return 1
fi
: > "$jobs_file"
run_frontend_coverage_job
wait_for_jobs
}
run_rust_lane() {
if [[ "${RUST_CHANGED:-true}" != "true" ]]; then
log_lane 'skipped because RUST_CHANGED=false'
return 0
fi
bash .chunk/run-rust-gate.sh
}
run_playwright_lane() {
sync_node_dependencies
export PLAYWRIGHT_SHARED_SERVER="${PLAYWRIGHT_SHARED_SERVER:-1}"
export PLAYWRIGHT_CONCURRENCY="${PLAYWRIGHT_CONCURRENCY:-4}"
local shards="${PLAYWRIGHT_SHARDS:-8}"
log_lane "shards=${shards}; concurrency=${PLAYWRIGHT_CONCURRENCY}; shared server=${PLAYWRIGHT_SHARED_SERVER}"
bash .chunk/run-playwright-shards.sh "$shards"
}
case "$lane" in
frontend)
run_frontend_lane
;;
rust)
run_rust_lane
;;
playwright)
run_playwright_lane
;;
*)
printf 'Usage: %s frontend|rust|playwright\n' "$0" >&2
exit 2
;;
esac
log_lane "completed in $(elapsed_seconds)s"

View file

@ -0,0 +1,133 @@
# Create Architecture Decision Record
Use this command when you need to document an architectural decision made during a task.
Inspired by [adr-tools](https://github.com/npryce/adr-tools) (Nygard format), adapted for Laputa's frontmatter-based note format.
## When to use this
Create an ADR when your work involves any of these:
- Choosing a storage strategy (vault vs app settings vs database)
- Adding or removing a major dependency
- Supporting a new platform or target
- Introducing or removing a core abstraction
- Making a cross-cutting decision that affects how future code should be written
Do NOT create ADRs for: bug fixes, UI styling, refactors that preserve behavior, or test additions.
## Creating a new ADR
### 1. Find the next ID
```bash
ls docs/adr/*.md | grep -oP '\d{4}' | sort -n | tail -1 | xargs -I{} printf '%04d\n' $(({} + 1))
```
If no files exist yet, start at `0001`.
### 2. Create the file
Filename: `docs/adr/NNNN-short-kebab-title.md`
Template:
```markdown
---
type: ADR
id: "NNNN"
title: "Short decision title"
status: active
date: YYYY-MM-DD
---
## Context
The issue motivating this decision, and any context that influences or constrains it.
## Decision
**The change we're proposing or have agreed to implement.** State it clearly in one or two sentences — bold so it stands out.
## Options considered
- **Option A** (chosen): brief description — pros / cons
- **Option B**: brief description — pros / cons
- **Option C**: brief description — pros / cons
## Consequences
What becomes easier or harder as a result?
What risks does this introduce that will need to be mitigated?
What would trigger re-evaluation of this decision?
## Advice
*(optional)* Input received before making this decision — who was consulted, what they said.
Omit this section if the decision was made without external input.
```
### 3. Update the index
Add a row to `docs/adr/README.md`:
```markdown
| [NNNN](NNNN-short-kebab-title.md) | Title | active |
```
### 4. Include in the same commit as the feature
```bash
git add docs/adr/NNNN-*.md docs/adr/README.md
# fold into the feature commit — do not create a separate commit just for the ADR
```
---
## Superseding an existing ADR
Equivalent of `adr new -s <N>` from adr-tools — do this in two steps:
### Step 1: Mark the old ADR as superseded
Edit the existing file — add `superseded_by` and update `status`:
```yaml
---
type: ADR
id: "000N"
title: "Old decision title"
status: superseded # ← change from active
superseded_by: "NNNN" # ← add this
date: YYYY-MM-DD
---
```
**Never edit the content sections** of an active ADR — only the status metadata.
### Step 2: Create the new ADR
Follow the steps above. In the **Context** section, reference the superseded ADR:
```markdown
## Context
Supersedes [ADR-000N](000N-old-title.md).
[explain why the old decision no longer holds]
```
### Step 3: Update the README index
Change the old row's status to `superseded`, add the new row.
---
## Best practices (from adr-tools / Nygard)
- **One decision per ADR** — if you find yourself writing "and also", split it
- **Write Decision first** — if you can't state it in 1-2 sentences, the decision is too vague
- **Context is the "why now"** — what forced this decision to be made today?
- **Consequences should include negatives** — a one-sided ADR is a red flag
- **Committed = immutable** — once pushed, the content doesn't change; only status metadata does
- **If in doubt, create one** — cheaper to have an unnecessary ADR than to lose context
- Date = today's date, `YYYY-MM-DD`

View file

@ -0,0 +1,42 @@
# /laputa-done <task_id>
Mark a Laputa task as done: add completion comment, move to In Review, then self-dispatch the next task.
Run this after Phase 1 (Playwright) and Phase 2 (native app QA) both pass **and `git push origin main` has succeeded**.
⚠️ A task is NOT done until the push succeeds. If the push is blocked by the pre-push hook (clippy, tests, CodeScene, build):
- Read the error
- Fix it (never use `--no-verify`)
- Commit the fix and push again
- Repeat until push exits with code 0
## Steps
**1. Add completion comment to the task**
Summarize what was done — this is the context Luca and Brian will read in Todoist:
```bash
curl -s -X POST "https://api.todoist.com/api/v1/comments" \
-H "Authorization: Bearer $TODOIST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"task_id": "$ARGUMENTS",
"content": "✅ Implementation complete.\n\n**What changed:** [brief summary of the implementation]\n**ADR:** [if an ADR was created, reference it here; otherwise omit]\n**Playwright:** all tests pass\n**Native QA:** tested with pnpm tauri dev — [describe what was tested and what was observed]"
}'
```
**2. Move task to In Review**
```bash
curl -s -X POST "https://api.todoist.com/api/v1/tasks/$ARGUMENTS/move" \
-H "Authorization: Bearer $TODOIST_API_KEY" \
-H "Content-Type: application/json" \
-d '{"section_id": "6g3XjX33FF4Vj86M"}'
```
**3. Pick the next task**
Run `/laputa-next-task` to get the next task and start working on it immediately.
If there are no tasks, `/laputa-next-task` will wait 10 minutes and retry automatically. Do NOT exit — stay alive and let it loop.

View file

@ -0,0 +1,60 @@
# /laputa-next-task
Pick the next Laputa task from Todoist and move it to In Progress.
Priority order: **To Rework** first, then **Open** (sorted by Todoist priority p1→p4).
## Steps
1. Fetch tasks from To Rework (`6g6QqvR9rRpvJWvv`), then Open (`6g3XjWR832hVHhCM`)
2. **Sort by priority — this is mandatory.** Todoist returns tasks in arbitrary order. You must sort them yourself:
- Todoist priority field: `4` = p1 (urgent), `3` = p2, `2` = p3, `1` = p4
- Sort descending by `priority` field (4 first, 1 last)
- To Rework tasks always come before Open tasks regardless of priority
- **Never pick a p3/p4 task if a p1/p2 task exists in the same section**
3. Take the first task from the sorted list
4. Move it to In Progress (`6g3XjWjfmJFcGgHM`) via Todoist API:
```bash
curl -s -X POST "https://api.todoist.com/api/v1/tasks/<task_id>/move" \
-H "Authorization: Bearer $TODOIST_API_KEY" \
-H "Content-Type: application/json" \
-d '{"section_id": "6g3XjWjfmJFcGgHM"}'
```
5. Add a "started" comment to the task:
```bash
curl -s -X POST "https://api.todoist.com/api/v1/comments" \
-H "Authorization: Bearer $TODOIST_API_KEY" \
-H "Content-Type: application/json" \
-d '{"task_id": "<task_id>", "content": "🚀 Starting work. [Brief description of approach or what needs to be fixed]"}'
```
6. Fetch the full task details (description, comments) from Todoist:
```bash
curl -s "https://api.todoist.com/api/v1/tasks/<task_id>" \
-H "Authorization: Bearer $TODOIST_API_KEY"
curl -s "https://api.todoist.com/api/v1/comments?task_id=<task_id>" \
-H "Authorization: Bearer $TODOIST_API_KEY"
```
6. For To Rework tasks: read the ❌ QA failed comment — it tells you exactly what to fix
7. Output: task ID, title, and full description so you can start working immediately
If no tasks are available in either section → wait 10 minutes and try again (loop forever):
```bash
while true; do
# ... check tasks ...
if no_tasks; then
sleep 600 # 10 minutes
else
break # got a task, proceed
fi
done
```
Do NOT exit when there are no tasks. Keep looping until a task appears. This keeps Claude Code alive permanently — the watchdog is a safety net only, not the primary dispatcher.

View file

@ -0,0 +1,11 @@
{
"permissions": {
"allow": [
"mcp__codescene__*",
"Read(*)",
"Bash(cat*)",
"Bash(ls*)",
"Write(*)"
]
}
}

View file

@ -0,0 +1,21 @@
---
exclude_paths:
- ".chunk/**"
- "coverage/**"
- "dist/**"
- "e2e/**"
- "node_modules/**"
- "scripts/**"
- "site/.vitepress/cache/**"
- "site/.vitepress/dist/**"
- "src/test/**"
- "src-tauri/gen/**"
- "src-tauri/resources/agent-docs/**"
- "src-tauri/resources/mcp-server/**"
- "src-tauri/target/**"
- "target/**"
- "test-results/**"
- "tests/**"
- "**/*.test.ts"
- "**/*.test.tsx"
- "vite.config.ts"

View file

@ -0,0 +1,2 @@
HOTSPOT_THRESHOLD=10.0
AVERAGE_THRESHOLD=9.99

View file

@ -0,0 +1,5 @@
# Exclude third-party tools and their dependencies from CodeScene analysis
tools/
e2e/
tests/
scripts/

View file

@ -0,0 +1,9 @@
{
"exclude": [
"tools/",
"scripts/",
"src-tauri/gen/",
"coverage/",
"dist/"
]
}

View file

@ -0,0 +1,83 @@
{
"scenarios": {
"small": {
"contentBytes": 1451,
"metrics": {
"blockApplyMs": {
"baselineMs": 12.3,
"maxMs": 37
},
"blockResolveMs": {
"baselineMs": 11.6,
"maxMs": 37
},
"editFrameMs": {
"baselineMs": 3.2,
"maxMs": 16
},
"editorVisibleMs": {
"baselineMs": 223.2,
"maxMs": 282
},
"firstContentMs": {
"baselineMs": 237.4,
"maxMs": 293
},
"fullAppliedMs": {
"baselineMs": 240.6,
"maxMs": 294
},
"noteOpenEditorSwapMs": {
"baselineMs": 90.4,
"maxMs": 115
},
"noteOpenTotalMs": {
"baselineMs": 138.7,
"maxMs": 180
}
},
"sectionCount": 5
},
"large": {
"contentBytes": 130377,
"metrics": {
"blockApplyMs": {
"baselineMs": 279.1,
"maxMs": 362
},
"blockResolveMs": {
"baselineMs": 37.8,
"maxMs": 63
},
"editFrameMs": {
"baselineMs": 5,
"maxMs": 16
},
"editorVisibleMs": {
"baselineMs": 197.9,
"maxMs": 261
},
"firstContentMs": {
"baselineMs": 305.1,
"maxMs": 401
},
"fullAppliedMs": {
"baselineMs": 508.4,
"maxMs": 664
},
"noteOpenEditorSwapMs": {
"baselineMs": 384.3,
"maxMs": 498
},
"noteOpenTotalMs": {
"baselineMs": 448.4,
"maxMs": 587
}
},
"sectionCount": 460
}
},
"version": 1,
"updatedAt": "2026-06-29T07:53:27.234Z",
"description": "Ratcheted editor performance budgets for synthetic small and large note opens. Lower is better; maxMs values should only move down unless intentionally rebaselined."
}

View file

@ -0,0 +1,18 @@
# Copy to .env.local and fill in real values.
# These are never committed — .env.local is gitignored.
# Release workflows must mirror these values into GitHub Actions secrets:
# - VITE_SENTRY_DSN
# - SENTRY_DSN (same value as VITE_SENTRY_DSN for Rust-side crash reporting)
# - VITE_POSTHOG_KEY
# - VITE_POSTHOG_HOST
# Sentry DSN (https://sentry.io → Project → Settings → Client Keys)
VITE_SENTRY_DSN=
# PostHog (https://posthog.com → Project → Settings → Project API Key)
VITE_POSTHOG_KEY=
VITE_POSTHOG_HOST=https://eu.i.posthog.com
# Lara CLI (https://github.com/translated/lara-cli)
LARA_ACCESS_KEY_ID=
LARA_ACCESS_KEY_SECRET=

View file

@ -0,0 +1,26 @@
name: Build Windows Installer on JD Node
on:
workflow_dispatch:
jobs:
build-windows:
runs-on: [self-hosted, linux, x64, jd-fd-primary]
env:
VITE_SENTRY_DSN: ""
SENTRY_DSN: ""
VITE_POSTHOG_KEY: ""
VITE_POSTHOG_HOST: ""
steps:
- uses: actions/checkout@v4
- name: Cross-build NSIS installer
run: ./scripts/build-windows-jd-cross.sh
- name: Upload internal installer
uses: actions/upload-artifact@v4
with:
name: HoloLake-Era-Windows-x64-internal
path: |
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*-setup.exe
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*-setup.exe.sha256
if-no-files-found: error
retention-days: 14

View file

@ -0,0 +1,3 @@
# Git Hooks
See .github/HOOKS.md for details.

View file

@ -0,0 +1,3 @@
# These are supported funding model platforms
custom: https://refactoring.fm/

View file

@ -0,0 +1,67 @@
# Git Hooks
This repo uses Husky hooks from `.husky/`. Those files are the source of truth.
## Installation
`pnpm install` runs the `prepare` script and installs the hooks into `.git/hooks`.
If you need to reinstall them manually:
```bash
pnpm exec husky
```
The hooks expect `node` and `pnpm` to be available. If they are installed via `nvm`, the hooks will try to load `~/.nvm/nvm.sh` automatically.
Documentation/workflow/hook-only commits and pushes are classified before Node tooling is required. Editing those files must not fail merely because `pnpm` is absent from the invoking shell.
## Policy
- Commit on `main` or in a detached verification worktree intended for direct promotion.
- Push `main -> origin/main` or detached `HEAD -> origin/main` only.
- Never use `--no-verify`.
- `.codescene-thresholds` is a ratchet. It can only move up.
- CodeScene is additive when credentials are already configured. Missing credentials are not a Git transport error and must not prompt account creation, a trial, or a purchase.
- The Fifth Domain Router is a separate, explicitly authorized prototype-publication path. Its exact-SHA receipt proves only that an allowlisted branch reached the code channel; it does not replace `main -> main` production promotion.
## Pre-commit
`.husky/pre-commit` blocks commits unless all applicable checks are true:
- staged TypeScript files pass `pnpm lint --quiet`
- documentation/workflow/hook-only commits are identified without running application checks
If `CODESCENE_PAT` or `CODESCENE_PROJECT_ID` is missing, the CodeScene portion is skipped, but the rest of the hook still runs. Record CodeScene as `not_run_unconfigured`; do not treat the skip as a failed commit.
## Pre-push
`.husky/pre-push` blocks pushes unless all of the following are true:
- the current state is `main` or detached `HEAD`
- every pushed branch ref is `refs/heads/main -> refs/heads/main` or detached `HEAD -> refs/heads/main`
- TypeScript and the Vite build pass
- frontend coverage passes
- Rust lint and Rust coverage pass when `src-tauri/` changed
- the curated Playwright core smoke lane passes via `pnpm playwright:smoke`
- current CodeScene Hotspot and Average health are both at or above `.codescene-thresholds`
If the remote CodeScene scores are better than the current thresholds, the hook updates `.codescene-thresholds`, stages it, and stops the push. Commit that file normally, then push again. The hook does not auto-commit or bypass itself.
If CodeScene credentials are missing, the hook prints a warning and continues after all repository-owned checks pass. This is the intended no-subscription behavior.
## Legacy Files
The legacy `pre-commit` file under `.github/hooks/` is archival only. Do not copy it into `.git/hooks`; use Husky and `.husky/` instead. The old design `post-commit` auto-implementation hook was removed because it depended on obsolete one-off scripts. `install-hooks.sh` remains as a reinstall helper that runs Husky.
## Troubleshooting
If a hook cannot find `node` or `pnpm`:
```bash
export NVM_DIR="$HOME/.nvm"
. "$NVM_DIR/nvm.sh"
nvm use node
```
Then retry the commit or push.

View file

@ -0,0 +1,227 @@
# CI/CD Setup Guide
## Quick Start
### 1. Add GitHub Secrets
Nel repository GitHub (Settings → Secrets and variables → Actions → New repository secret):
**CODESCENE_TOKEN**
```
<il tuo CodeScene PAT — stesso di ~/.codescene/token>
```
**CODESCENE_PROJECT_ID**
Trova l'ID del progetto nella dashboard CodeScene (URL: `https://codescene.io/projects/<PROJECT_ID>/...`)
**VITE_SENTRY_DSN**
```
<frontend Sentry DSN used by shipped Tolaria builds>
```
**SENTRY_DSN**
```
<same DSN as VITE_SENTRY_DSN, passed to the Rust/Tauri build for native crash reporting>
```
**VITE_POSTHOG_KEY**
```
<PostHog project API key used by shipped Tolaria builds>
```
**VITE_POSTHOG_HOST**
```
https://eu.i.posthog.com
```
**Windows Authenticode release signing**
Windows release artifacts can be Authenticode-signed when a trusted code-signing certificate is available. Until Windows certificate provisioning is complete, the release workflow warns and publishes Windows artifacts with Tauri updater signatures only.
To enable Authenticode, configure a trusted certificate exported as base64 PFX data:
```
WINDOWS_CODE_SIGNING_CERTIFICATE=<base64-encoded pfx>
WINDOWS_CODE_SIGNING_CERTIFICATE_PASSWORD=<pfx password>
```
Optional:
```
WINDOWS_CODE_SIGNING_CERTIFICATE_THUMBPRINT=<expected certificate thumbprint>
WINDOWS_CODE_SIGNING_TIMESTAMP_URL=https://timestamp.digicert.com
```
Legacy aliases `WINDOWS_CERTIFICATE`, `WINDOWS_CERTIFICATE_PASSWORD`, `WINDOWS_CERTIFICATE_THUMBPRINT`, and `WINDOWS_TIMESTAMP_URL` are still accepted by the signing script. Do not use a self-signed certificate for public releases; Windows Authenticode release signing needs a certificate from a trusted CA or signing service.
### 2. Enable GitHub Actions
- Vai su Settings → Actions → General
- Assicurati che "Allow all actions and reusable workflows" sia selezionato
### 3. Configure Branch Protection (Optional ma Raccomandato)
Settings → Branches → Add branch protection rule:
**Branch name pattern**: `main`
Abilita:
- ✅ Require status checks to pass before merging
- Select: `Tests & Quality Checks`
- ✅ Require branches to be up to date before merging
- ✅ Do not allow bypassing the above settings
Questo forza tutti i check a passare prima di poter fare merge su main.
### 4. Test Locally Prima di Pushare
```bash
# Full test suite
pnpm test && cargo test --manifest-path=src-tauri/Cargo.toml
# Coverage
pnpm test:coverage
# Lint
pnpm lint
cargo clippy --manifest-path=src-tauri/Cargo.toml
# Format check
cargo fmt --manifest-path=src-tauri/Cargo.toml -- --check
```
## What Gets Checked
### ✅ Tests
- Frontend: Vitest
- Backend: `cargo test`
### 📊 Coverage
- Threshold: 70% (lines, functions, branches, statements)
- Configurabile in `vite.config.ts`
### 🏥 Code Health
- CodeScene delta analysis
- **Fail se code health diminuisce**
- Confronta HEAD vs base branch
### 📡 Telemetry In Release Builds
- `release.yml` e `release-stable.yml` devono ricevere `VITE_SENTRY_DSN`, `SENTRY_DSN`, `VITE_POSTHOG_KEY`, `VITE_POSTHOG_HOST`
- `VITE_SENTRY_DSN` inizializza il frontend Sentry bundle
- `SENTRY_DSN` inizializza Sentry nel binary Rust/Tauri
- `VITE_POSTHOG_KEY` / `VITE_POSTHOG_HOST` permettono ai build distribuiti di inizializzare PostHog quando l'utente abilita analytics
### 📝 Documentation
- **Warning se modifichi `src/` o `src-tauri/` ma non aggiorni `docs/`**
- Non blocca il merge, solo un reminder
- Skip il check con `[skip docs]` nel commit message
- Aggiorna docs solo se la modifica invalida qualcosa già documentato
### 🎨 Lint & Format
- ESLint per frontend
- Clippy + rustfmt per Rust
## Workflow File
Il workflow è in `.github/workflows/ci.yml`.
**Trigger**:
- Push su `main` o `experiment/*`
- Pull request verso `main`
**Runner**: `macos-latest` (necessario per Tauri + Rust)
## Customization
### Soglie Coverage
Modifica `vite.config.ts`:
```typescript
coverage: {
thresholds: {
lines: 80, // Aumenta se vuoi più coverage
functions: 80,
branches: 80,
statements: 80,
}
}
```
### Documentation Check
Il check **avvisa** (non fallisce) se:
1. Modifichi file in `src/` o `src-tauri/`
2. NON modifichi nulla in `docs/`
**Quando aggiornare docs:**
- Cambi architettura → aggiorna `docs/ARCHITECTURE.md`
- Cambi astrazioni chiave → aggiorna `docs/ABSTRACTIONS.md`
- Cambi theme system → aggiorna `docs/THEMING.md`
- Bug fix / refactor interno → `[skip docs]` nel commit message
**Skip il check:**
```bash
git commit -m "fix: editor scroll bug [skip docs]"
```
### CodeScene Fail Threshold
Nel workflow, modifica:
```yaml
- name: CodeScene Delta Analysis
uses: codescene-oss/codescene-delta-analysis-action@v1
with:
fail-on-declining-code-health: true # Cambia a false per warning-only
minimum-code-health-score: 8.0 # Aggiungi per soglia assoluta
```
## Troubleshooting
### CodeScene fails con "Project not found"
- Verifica che `CODESCENE_PROJECT_ID` sia corretto
- Controlla che il token abbia accesso al progetto
### Coverage check fails
- Verifica che `@vitest/coverage-v8` sia installato: `pnpm add -D @vitest/coverage-v8`
- Le soglie sono configurabili in `vite.config.ts`
### Docs check avvisa anche se non serve aggiornare docs
- È solo un warning, non blocca
- Skip con `[skip docs]` nel commit message
- Oppure ignora — è un reminder, non un requisito
### Workflow non si attiva
- Verifica che il file sia in `.github/workflows/ci.yml`
- Controlla che GitHub Actions sia abilitato nelle settings
- Il workflow parte solo su push/PR verso `main` o branch `experiment/*`
## Example CI Pass
```
✅ Run frontend tests
✅ Run Rust tests
✅ Run frontend coverage (75% lines, 73% functions)
✅ CodeScene Delta Analysis (code health: 9.2 → 9.3)
✅ Check docs are updated (docs/ARCHITECTURE.md modified)
✅ Lint frontend
✅ Clippy (Rust)
✅ Format check (Rust)
```
## Example CI Warning
```
⚠️ Code files changed but docs/ not updated
Changed code files:
- src/components/Editor.tsx
- src-tauri/src/vault.rs
If this change affects architecture/abstractions/design documented in docs/,
please update the relevant documentation files.
To skip this check, include [skip docs] in your commit message.
```
Questo è solo un reminder. Se la modifica non invalida la documentazione esistente, puoi ignorarlo o usare `[skip docs]`.

View file

@ -0,0 +1,26 @@
#!/bin/bash
set -e
if ! command -v pnpm >/dev/null 2>&1 || ! command -v node >/dev/null 2>&1; then
export NVM_DIR="${NVM_DIR:-$HOME/.nvm}"
if [ -s "$NVM_DIR/nvm.sh" ]; then
# shellcheck disable=SC1090
. "$NVM_DIR/nvm.sh" --no-use
nvm use --silent node >/dev/null 2>&1 || true
fi
fi
if ! command -v pnpm >/dev/null 2>&1 || ! command -v node >/dev/null 2>&1; then
echo "❌ node and pnpm must be available to install Husky hooks"
exit 1
fi
echo "Installing Husky hooks from .husky/ ..."
pnpm exec husky
echo "✅ Husky hooks installed"
echo ""
echo "Source of truth:"
echo " - .husky/pre-commit"
echo " - .husky/pre-push"
echo ""
echo "Never use --no-verify in this repo."

View file

@ -0,0 +1,81 @@
#!/bin/bash
# Pre-commit hook: CodeScene Code Health Check
# Copy to .git/hooks/pre-commit and make executable
set -e
# Allow bypass with --no-verify or [skip codescene] in commit message
if git log -1 --pretty=%B 2>/dev/null | grep -qi '\[skip codescene\]'; then
echo "⏭️ CodeScene check skipped (commit message contains [skip codescene])"
exit 0
fi
echo "🔍 Running CodeScene Code Health check..."
# Check if we have staged files to analyze
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(ts|tsx|rs)$' || true)
if [ -z "$STAGED_FILES" ]; then
echo "✅ No TypeScript/Rust files staged, skipping CodeScene check"
exit 0
fi
# Get current branch
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
# Determine base branch for comparison
if [ "$CURRENT_BRANCH" = "main" ]; then
BASE_REF="HEAD~1"
else
BASE_REF="origin/main"
fi
echo " Comparing against: $BASE_REF"
# Check if we have CodeScene configured (MCP or CLI)
CODESCENE_MCP_CONFIG="$HOME/.claude/mcp.json"
CODESCENE_TOKEN_FILE="$HOME/.codescene/token"
if [ ! -f "$CODESCENE_MCP_CONFIG" ] && [ ! -f "$CODESCENE_TOKEN_FILE" ]; then
echo "⚠️ CodeScene not configured"
echo " Install CodeScene MCP (configured in ~/.claude/mcp.json)"
echo " Or place token at ~/.codescene/token"
echo " Proceeding without check (use 'git commit --no-verify' to skip this warning)"
exit 0
fi
# Simple health check using git diff stats
echo " Analyzing code changes..."
# Get file changes
LINES_ADDED=$(git diff --cached --numstat | awk '{sum+=$1} END {print sum}')
LINES_REMOVED=$(git diff --cached --numstat | awk '{sum+=$2} END {print sum}')
# Check for large files (potential complexity)
LARGE_FILES=$(git diff --cached --numstat | awk '$1 > 500 || $2 > 500 {print $3}')
if [ ! -z "$LARGE_FILES" ]; then
echo "⚠️ Large file changes detected (>500 lines):"
echo "$LARGE_FILES" | sed 's/^/ - /'
echo ""
echo " Consider:"
echo " - Breaking into smaller commits"
echo " - Reviewing with Claude Code + CodeScene MCP"
echo " - Running: claude 'Review code health of staged changes'"
echo ""
read -p " Continue anyway? (y/N) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "❌ Commit aborted"
exit 1
fi
fi
echo "✅ CodeScene check passed"
echo " +$LINES_ADDED -$LINES_REMOVED lines"
echo ""
echo " 💡 For detailed code health analysis, run:"
echo " claude 'Check code health of this commit with CodeScene MCP'"
echo ""
exit 0

View file

@ -0,0 +1,115 @@
param(
[string]$ConfigPath = "src-tauri/tauri.windows-signing.conf.json"
)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
function Read-FirstEnv {
param([string[]]$Names)
foreach ($Name in $Names) {
$Value = [Environment]::GetEnvironmentVariable($Name)
if (-not [string]::IsNullOrWhiteSpace($Value)) {
return $Value.Trim()
}
}
throw "Set one of these environment variables: $($Names -join ', ')"
}
function Read-OptionalEnv {
param(
[string[]]$Names,
[string]$DefaultValue
)
foreach ($Name in $Names) {
$Value = [Environment]::GetEnvironmentVariable($Name)
if (-not [string]::IsNullOrWhiteSpace($Value)) {
return $Value.Trim()
}
}
return $DefaultValue
}
function Normalize-Thumbprint {
param([string]$Thumbprint)
return ($Thumbprint -replace "\s", "").ToUpperInvariant()
}
function Convert-CertificateSecretToBytes {
param([string]$CertificateSecret)
$Base64Lines = $CertificateSecret -split "\r?\n" |
Where-Object { $_ -notmatch "^-+BEGIN " -and $_ -notmatch "^-+END " }
$CertificateBase64 = ($Base64Lines -join "") -replace "\s", ""
try {
return [Convert]::FromBase64String($CertificateBase64)
} catch {
throw "Windows code-signing certificate must be base64-encoded PFX data."
}
}
$CertificateSecret = Read-FirstEnv @("WINDOWS_CODE_SIGNING_CERTIFICATE", "WINDOWS_CERTIFICATE")
$CertificatePassword = Read-FirstEnv @("WINDOWS_CODE_SIGNING_CERTIFICATE_PASSWORD", "WINDOWS_CERTIFICATE_PASSWORD")
$ConfiguredThumbprint = Read-OptionalEnv @("WINDOWS_CODE_SIGNING_CERTIFICATE_THUMBPRINT", "WINDOWS_CERTIFICATE_THUMBPRINT") ""
$DigestAlgorithm = Read-OptionalEnv @("WINDOWS_CODE_SIGNING_DIGEST_ALGORITHM") "sha256"
$TimestampUrl = Read-OptionalEnv @("WINDOWS_CODE_SIGNING_TIMESTAMP_URL", "WINDOWS_TIMESTAMP_URL") "http://timestamp.digicert.com"
$TempRoot = Join-Path ([IO.Path]::GetTempPath()) "tolaria-windows-signing"
if (-not [string]::IsNullOrWhiteSpace($env:RUNNER_TEMP)) {
$TempRoot = Join-Path $env:RUNNER_TEMP "tolaria-windows-signing"
}
New-Item -ItemType Directory -Force -Path $TempRoot | Out-Null
$PfxPath = Join-Path $TempRoot "certificate.pfx"
[IO.File]::WriteAllBytes($PfxPath, (Convert-CertificateSecretToBytes $CertificateSecret))
$SecurePassword = ConvertTo-SecureString -String $CertificatePassword -Force -AsPlainText
$ImportedCertificates = @(Import-PfxCertificate -FilePath $PfxPath -CertStoreLocation Cert:\CurrentUser\My -Password $SecurePassword)
Remove-Item -Force -ErrorAction SilentlyContinue $PfxPath
$ImportedCertificate = $ImportedCertificates | Where-Object { $_.HasPrivateKey } | Select-Object -First 1
if ($null -eq $ImportedCertificate) {
throw "The imported Windows code-signing certificate does not include a private key."
}
if ([string]::IsNullOrWhiteSpace($ConfiguredThumbprint)) {
$CertificateThumbprint = Normalize-Thumbprint $ImportedCertificate.Thumbprint
} else {
$CertificateThumbprint = Normalize-Thumbprint $ConfiguredThumbprint
}
$StoreCertificate = Get-ChildItem Cert:\CurrentUser\My |
Where-Object { (Normalize-Thumbprint $_.Thumbprint) -eq $CertificateThumbprint } |
Select-Object -First 1
if ($null -eq $StoreCertificate) {
throw "The requested Windows code-signing certificate thumbprint was not found in Cert:\CurrentUser\My."
}
$Config = @{
bundle = @{
windows = @{
certificateThumbprint = $CertificateThumbprint
digestAlgorithm = $DigestAlgorithm
timestampUrl = $TimestampUrl
}
}
}
$ResolvedConfigPath = Resolve-Path -Path (Split-Path -Parent $ConfigPath) -ErrorAction SilentlyContinue
if ($null -eq $ResolvedConfigPath) {
New-Item -ItemType Directory -Force -Path (Split-Path -Parent $ConfigPath) | Out-Null
}
$Config | ConvertTo-Json -Depth 10 | Set-Content -Path $ConfigPath -Encoding utf8NoBOM
if (-not [string]::IsNullOrWhiteSpace($env:GITHUB_ENV)) {
"WINDOWS_CODE_SIGNING_CERTIFICATE_THUMBPRINT=$CertificateThumbprint" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
}
Write-Host "Prepared Windows Authenticode signing config at $ConfigPath."

View file

@ -0,0 +1,137 @@
$ErrorActionPreference = "Stop"
$nsisUrl = "https://github.com/tauri-apps/binary-releases/releases/download/nsis-3.11/nsis-3.11.zip"
$nsisSha1 = "EF7FF767E5CBD9EDD22ADD3A32C9B8F4500BB10D"
$tauriUtilsUrl = "https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.5.3/nsis_tauri_utils.dll"
$tauriUtilsSha1 = "75197FEE3C6A814FE035788D1C34EAD39349B860"
$tauriUtilsRelativePath = "Plugins\x86-unicode\additional\nsis_tauri_utils.dll"
$nsisRequiredFiles = @(
"makensis.exe",
"Bin\makensis.exe",
"Stubs\lzma-x86-unicode",
"Stubs\lzma_solid-x86-unicode",
"Include\MUI2.nsh",
"Include\FileFunc.nsh",
"Include\x64.nsh",
"Include\nsDialogs.nsh",
"Include\WinMessages.nsh",
"Include\Win\COM.nsh",
"Include\Win\Propkey.nsh",
"Include\Win\RestartManager.nsh"
)
function Get-UpperSha1 {
param([Parameter(Mandatory = $true)][string]$Path)
return (Get-FileHash -Algorithm SHA1 -LiteralPath $Path).Hash.ToUpperInvariant()
}
function Test-FileSha1 {
param(
[Parameter(Mandatory = $true)][string]$Path,
[Parameter(Mandatory = $true)][string]$ExpectedSha1
)
return (Test-Path -LiteralPath $Path) -and ((Get-UpperSha1 -Path $Path) -eq $ExpectedSha1)
}
function Save-VerifiedDownload {
param(
[Parameter(Mandatory = $true)][string]$Uri,
[Parameter(Mandatory = $true)][string]$OutFile,
[Parameter(Mandatory = $true)][string]$ExpectedSha1
)
$parent = Split-Path -Parent $OutFile
New-Item -ItemType Directory -Force -Path $parent | Out-Null
$tempFile = "$OutFile.download"
for ($attempt = 1; $attempt -le 5; $attempt++) {
try {
Remove-Item -Force -ErrorAction SilentlyContinue -LiteralPath $tempFile
Invoke-WebRequest -Uri $Uri -OutFile $tempFile -TimeoutSec 120
$actualSha1 = Get-UpperSha1 -Path $tempFile
if ($actualSha1 -ne $ExpectedSha1) {
throw "SHA1 mismatch for $Uri. Expected $ExpectedSha1, got $actualSha1."
}
Move-Item -Force -LiteralPath $tempFile -Destination $OutFile
return
} catch {
Remove-Item -Force -ErrorAction SilentlyContinue -LiteralPath $tempFile
if ($attempt -eq 5) {
throw
}
$delaySeconds = [Math]::Min(30, 5 * $attempt)
Write-Warning "Download attempt ${attempt} failed: $($_.Exception.Message). Retrying in ${delaySeconds}s."
Start-Sleep -Seconds $delaySeconds
}
}
}
function Find-MissingFile {
param(
[Parameter(Mandatory = $true)][string]$Root,
[Parameter(Mandatory = $true)][string[]]$RelativePaths
)
foreach ($relativePath in $RelativePaths) {
if (-not (Test-Path -LiteralPath (Join-Path $Root $relativePath))) {
return $relativePath
}
}
return $null
}
if ([string]::IsNullOrWhiteSpace($env:LOCALAPPDATA)) {
throw "LOCALAPPDATA is required to resolve Tauri's Windows tool cache."
}
$tauriToolsPath = Join-Path $env:LOCALAPPDATA "tauri"
$nsisPath = Join-Path $tauriToolsPath "NSIS"
$downloadRoot = if ([string]::IsNullOrWhiteSpace($env:RUNNER_TEMP)) {
[System.IO.Path]::GetTempPath()
} else {
$env:RUNNER_TEMP
}
New-Item -ItemType Directory -Force -Path $tauriToolsPath | Out-Null
$missingNsisFile = Find-MissingFile -Root $nsisPath -RelativePaths $nsisRequiredFiles
if ($missingNsisFile) {
Write-Host "Tauri NSIS cache is missing $missingNsisFile; downloading NSIS 3.11."
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -LiteralPath $nsisPath
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -LiteralPath (Join-Path $tauriToolsPath "nsis-3.11")
$zipPath = Join-Path $downloadRoot "nsis-3.11.zip"
Save-VerifiedDownload -Uri $nsisUrl -OutFile $zipPath -ExpectedSha1 $nsisSha1
Expand-Archive -Force -LiteralPath $zipPath -DestinationPath $tauriToolsPath
$extractedNsisPath = Join-Path $tauriToolsPath "nsis-3.11"
if (-not (Test-Path -LiteralPath $extractedNsisPath)) {
throw "Downloaded NSIS archive did not contain the expected nsis-3.11 directory."
}
Move-Item -Force -LiteralPath $extractedNsisPath -Destination $nsisPath
} else {
Write-Host "Tauri NSIS cache already contains NSIS 3.11."
}
$tauriUtilsPath = Join-Path $nsisPath $tauriUtilsRelativePath
if (-not (Test-FileSha1 -Path $tauriUtilsPath -ExpectedSha1 $tauriUtilsSha1)) {
Write-Host "Downloading Tauri NSIS utility plugin."
Save-VerifiedDownload -Uri $tauriUtilsUrl -OutFile $tauriUtilsPath -ExpectedSha1 $tauriUtilsSha1
} else {
Write-Host "Tauri NSIS utility plugin is already cached."
}
$missingFile = Find-MissingFile -Root $nsisPath -RelativePaths ($nsisRequiredFiles + @($tauriUtilsRelativePath))
if ($missingFile) {
throw "Tauri NSIS toolchain is incomplete after prefetch; missing $missingFile."
}
Write-Host "Tauri NSIS toolchain ready at $nsisPath."

View file

@ -0,0 +1,133 @@
# CI/CD Setup
## GitHub Actions Workflow
Il workflow `ci.yml` esegue i seguenti check automatici:
### 1. Tests
- Frontend: `pnpm test`
- Rust backend: `cargo test`
### 2. Test Coverage
- Frontend: vitest con coverage reporting
- Upload automatico su Codecov dai report LCOV frontend + Rust
- Threshold configurabile in `vitest.config.ts`
### 3. Code Health (CodeScene)
- Delta analysis su ogni PR/push
- Fail se il code health diminuisce
- Richiede secrets configurati (vedi sotto)
### 4. Documentation Check
- Verifica che se cambia codice in `src/` o `src-tauri/`, anche `docs/` viene aggiornato
- **Warning only** — non blocca il merge, solo un reminder
- Skip con `[skip docs]` nel commit message
- Aggiorna docs solo se la modifica invalida architettura/astrazioni/design già documentati
### 5. Lint & Format
- ESLint per frontend
- Clippy + rustfmt per Rust
## Setup Required
### CodeScene Secrets
Aggiungi questi secrets nel repository GitHub (Settings → Secrets → Actions):
```
CODESCENE_TOKEN=<your-codescene-pat>
CODESCENE_PROJECT_ID=<your-project-id>
```
Il PAT di CodeScene è lo stesso che usi localmente (~/.codescene/token).
Il project ID lo trovi nella dashboard CodeScene.
### Codecov Setup
- Installa/attiva il repo in Codecov una volta sola tramite GitHub App / import del repository.
- Nessun `CODECOV_TOKEN` richiesto in GitHub Actions: `ci.yml` usa OIDC (`id-token: write` + `use_oidc: true`).
- Il workflow carica `coverage/lcov.info` (Vitest) e `coverage/rust.lcov` (cargo-llvm-cov).
- L'action Codecov resta con integrity validation attiva. Se Codecov ruota la chiave GPG del CLI, aggiorna il pin dell'action invece di usare `skip_validation`.
### Telemetry Secrets For Release Builds
Aggiungi anche questi secrets per i workflow `release.yml` e `release-stable.yml`:
```
VITE_SENTRY_DSN=<frontend sentry dsn>
SENTRY_DSN=<same dsn for rust/native crash reporting>
VITE_POSTHOG_KEY=<posthog project api key>
VITE_POSTHOG_HOST=https://eu.i.posthog.com
```
Senza questi valori, i build distribuiti possono mantenere i toggle telemetry nelle Settings ma non inizializzare davvero PostHog/Sentry.
### Windows Authenticode Secrets For Release Builds
Windows alpha e stable release builds usano sempre le firme Tauri updater. Se i secret Authenticode sono presenti, il workflow firma anche gli installer Windows e verifica le firme; se mancano, emette un warning e pubblica gli artifact Windows senza Authenticode finche' il certificato non e' pronto.
```
WINDOWS_CODE_SIGNING_CERTIFICATE=<base64-encoded pfx>
WINDOWS_CODE_SIGNING_CERTIFICATE_PASSWORD=<pfx password>
```
Opzionale:
```
WINDOWS_CODE_SIGNING_CERTIFICATE_THUMBPRINT=<expected thumbprint>
WINDOWS_CODE_SIGNING_TIMESTAMP_URL=https://timestamp.digicert.com
```
Il certificato deve essere un certificato di code signing trusted; un certificato self-signed non e' adatto per i release artifact pubblici.
### Coverage Thresholds
Configura in `vitest.config.ts`:
```typescript
export default defineConfig({
test: {
coverage: {
lines: 80,
functions: 80,
branches: 80,
statements: 80,
// Fail CI se sotto threshold
thresholds: {
lines: 80,
functions: 80,
branches: 80,
statements: 80
}
}
}
})
```
## Local Testing
Prima di pushare, puoi testare localmente:
```bash
# Run all tests
pnpm test && cargo test
# Check coverage
pnpm test:coverage
# Lint
pnpm lint
cargo clippy
cargo fmt --check
# CodeScene (local)
codescene delta-analysis --base-revision origin/main
```
## Workflow Triggers
- **Push**: su `main`
- **Pull Request**: verso `main`
- **Manuale**: `workflow_dispatch`
Nota: l'upload a Codecov gira su push a `main` e sulle PR dello stesso repository. Le PR da fork saltano l'upload per evitare problemi di permessi OIDC.
## Status Checks
Tutti i check devono passare prima di poter fare merge.
Se un check fallisce, vedrai il dettaglio nei logs di GitHub Actions.

View file

@ -0,0 +1,38 @@
name: Auto-update PR branches
# When main advances, automatically update all open PR branches
# so they stay up to date and can be auto-merged without manual rebase.
on:
push:
branches: [main]
jobs:
update-prs:
name: Update open PR branches
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update all open PR branches
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get all open PRs targeting main
PRS=$(gh pr list --base main --state open --json number,headRefName --jq '.[]')
echo "$PRS" | while IFS= read -r pr; do
PR_NUM=$(echo "$pr" | jq -r '.number')
BRANCH=$(echo "$pr" | jq -r '.headRefName')
echo "Updating PR #$PR_NUM ($BRANCH)..."
# GitHub native update — does a merge of main into the branch
gh pr update-branch "$PR_NUM" 2>&1 && echo "✅ #$PR_NUM updated" || echo "⚠️ #$PR_NUM skipped (already up to date or conflict)"
done

View file

@ -0,0 +1,110 @@
name: Build Windows GLS Team Foundation
on:
push:
branches:
- main
workflow_dispatch:
inputs:
version:
description: "GLS team installer version"
required: true
default: "0.1.7"
env:
NODE_OPTIONS: --max-old-space-size=4096
RUST_TARGET_CACHE_VERSION: v2026-07-19-hololake-team-windows-xwin
jobs:
build-windows:
name: Build Windows x64 GLS team installer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
- name: Install Linux cross-build dependencies
run: |
sudo apt-get update
sudo apt-get install -y nsis lld llvm clang
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
src-tauri/target
.xwin-cache
key: ${{ runner.os }}-team-windows-cargo-x86_64-pc-windows-msvc-${{ env.RUST_TARGET_CACHE_VERSION }}-${{ hashFiles('src-tauri/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-team-windows-cargo-x86_64-pc-windows-msvc-${{ env.RUST_TARGET_CACHE_VERSION }}-
- name: Install cargo-xwin
run: cargo install --locked cargo-xwin
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Set app version
run: |
version="${{ inputs.version }}"
if [ -z "$version" ]; then version="0.1.7"; fi
jq --arg version "$version" '.version = $version' src-tauri/tauri.conf.json > src-tauri/tauri.conf.json.tmp
mv src-tauri/tauri.conf.json.tmp src-tauri/tauri.conf.json
sed -i "s/^version = \".*\"/version = \"$version\"/" src-tauri/Cargo.toml
- name: Build unsigned NSIS installer for GLS team testing
env:
VITE_SENTRY_DSN: ""
SENTRY_DSN: ""
VITE_POSTHOG_KEY: ""
VITE_POSTHOG_HOST: ""
XWIN_CACHE_DIR: ${{ github.workspace }}/.xwin-cache
run: |
pnpm tauri build \
--runner cargo-xwin \
--target x86_64-pc-windows-msvc \
--bundles nsis \
--config src-tauri/tauri.team.conf.json
- name: Validate installer
run: |
shopt -s nullglob
installers=(src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*-setup.exe)
if [ ${#installers[@]} -eq 0 ]; then
echo "::error::Windows build produced no NSIS setup executable."
exit 1
fi
for installer in "${installers[@]}"; do
echo "Built Windows GLS team installer: $installer"
file "$installer" | grep -q 'PE32' || {
echo "::error::Unexpected installer format: $installer"
exit 1
}
sha256sum "$installer" > "$installer.sha256"
done
- name: Upload Windows installer
uses: actions/upload-artifact@v4
with:
name: HoloLake-Era-Team-Foundation-Windows-x64
path: |
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*-setup.exe
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*-setup.exe.sha256
if-no-files-found: error
retention-days: 7

View file

@ -0,0 +1,296 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
id-token: write
env:
# Bump this when Tauri/Rust target artifacts capture stale absolute paths.
RUST_TARGET_CACHE_VERSION: v2026-04-14-tolaria
# Keep large production frontend builds below CI runner memory limits.
NODE_OPTIONS: --max-old-space-size=4096
jobs:
frontend-static-quality:
name: Frontend Static Quality Checks
runs-on: macos-15
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for CodeScene
- name: Setup pnpm
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
# Keep frontend and Rust quality gates in separate macOS jobs so the
# expensive Rust target cache restore no longer blocks the frontend lane.
# ── 0. Build check (catches type errors and bundler failures) ─────────
- name: TypeScript type check
run: pnpm exec tsc --noEmit
- name: Vite build check
# TypeScript is checked explicitly above; run Vite directly here to avoid
# paying for the package build script's duplicate `tsc -b` pass.
run: pnpm exec vite build
- name: Check whether docs build is needed
id: docs-changes
shell: bash
run: |
set -euo pipefail
BASE_SHA="${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}"
if [ "${{ github.event_name }}" = "workflow_dispatch" ] || [ -z "$BASE_SHA" ] || [[ "$BASE_SHA" =~ ^0+$ ]]; then
echo "should-build=true" >> "$GITHUB_OUTPUT"
exit 0
fi
if git diff --name-only "$BASE_SHA" HEAD | grep -qE '^(docs/|site/|scripts/build-agent-docs\.mjs|package\.json|pnpm-lock\.yaml|\.github/workflows/ci\.yml)'; then
echo "should-build=true" >> "$GITHUB_OUTPUT"
else
echo "should-build=false" >> "$GITHUB_OUTPUT"
fi
- name: Docs build check
if: steps.docs-changes.outputs.should-build == 'true'
run: pnpm docs:build
# ── 1. Code Health (CodeScene — Hotspot + Average Code Health gates) ──
# Enforces minimum floors on BOTH hotspot and average code health.
# Thresholds come from .codescene-thresholds so CI and local hooks match.
- name: Code Health gates
env:
CODESCENE_PAT: ${{ secrets.CODESCENE_PAT }}
CODESCENE_PROJECT_ID: ${{ secrets.CODESCENE_PROJECT_ID }}
run: |
HOTSPOT_THRESHOLD=$(grep '^HOTSPOT_THRESHOLD=' .codescene-thresholds | cut -d= -f2)
AVERAGE_THRESHOLD=$(grep '^AVERAGE_THRESHOLD=' .codescene-thresholds | cut -d= -f2)
API_RESPONSE=$(curl -sf \
-H "Authorization: Bearer $CODESCENE_PAT" \
-H "Accept: application/json" \
"https://api.codescene.io/v2/projects/$CODESCENE_PROJECT_ID")
HOTSPOT_SCORE=$(echo "$API_RESPONSE" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['analysis']['hotspot_code_health']['now'])")
AVERAGE_SCORE=$(echo "$API_RESPONSE" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['analysis']['code_health']['now'])")
echo "Hotspot Code Health: $HOTSPOT_SCORE (threshold: $HOTSPOT_THRESHOLD)"
echo "Average Code Health: $AVERAGE_SCORE (threshold: $AVERAGE_THRESHOLD)"
python3 -c "
hotspot = float('$HOTSPOT_SCORE')
average = float('$AVERAGE_SCORE')
ht = float('$HOTSPOT_THRESHOLD')
at = float('$AVERAGE_THRESHOLD')
failed = False
if hotspot < ht:
print(f'❌ Hotspot Code Health {hotspot:.2f} is below threshold {ht}')
failed = True
else:
print(f'✅ Hotspot Code Health {hotspot:.2f} ≥ {ht}')
if average < at:
print(f'❌ Average Code Health {average:.2f} is below threshold {at}')
failed = True
else:
print(f'✅ Average Code Health {average:.2f} ≥ {at}')
if failed:
exit(1)
"
# ── 2. Documentation check (warning only — does not fail build) ───────
- name: Check docs are updated
continue-on-error: true
run: |
if git log -1 --pretty=%B | grep -i '\[skip docs\]' > /dev/null; then
echo "⏭️ Documentation check skipped"
exit 0
fi
if git diff --name-only origin/main | grep -E '^(src/|src-tauri/)' > /dev/null; then
if ! git diff --name-only origin/main | grep -E '^docs/' > /dev/null; then
echo "⚠️ Code files changed but docs/ not updated"
git diff --name-only origin/main | grep -E '^(src/|src-tauri/)'
echo "If this change affects architecture/abstractions/theme documented in docs/, update them."
echo "To suppress: include [skip docs] in your commit message."
fi
fi
echo "✅ Documentation check passed"
# ── 3. Lint & format ──────────────────────────────────────────────────
- name: Lint frontend
run: pnpm lint
frontend-tests:
name: Frontend Tests & Coverage
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
# The coverage command runs the canonical frontend test suite.
- name: Bundle MCP server resources (required by Tauri build)
run: node scripts/bundle-mcp-server.mjs
- name: Frontend tests + coverage (≥70% lines/functions/branches/statements)
run: pnpm test:coverage
# Thresholds configured in vite.config.ts — exits non-zero if coverage drops
- name: Upload frontend coverage to Codecov
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
uses: codecov/codecov-action@5975040f7f7d40edaff8d784b576fd65ae95c073
with:
use_oidc: true
fail_ci_if_error: true
disable_search: true
files: ./coverage/lcov.info
flags: frontend
verbose: true
# OIDC avoids long-lived CODECOV_TOKEN secrets.
rust-quality:
name: Rust Tests & Quality Checks
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8
with:
components: rustfmt, clippy, llvm-tools-preview
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
src-tauri/target
key: ${{ runner.os }}-cargo-${{ env.RUST_TARGET_CACHE_VERSION }}-${{ hashFiles('src-tauri/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ env.RUST_TARGET_CACHE_VERSION }}-
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@e5de28abeb52d916c5e5875d54b21a9e738b61ec
- name: Rust tests + coverage (≥85% lines)
run: |
mkdir -p coverage
cargo llvm-cov \
--manifest-path src-tauri/Cargo.toml \
--ignore-filename-regex 'lib\.rs|main\.rs|menu\.rs' \
--lcov \
--output-path coverage/rust.lcov \
--fail-under-lines 85
# cargo-llvm-cov exits non-zero if line coverage drops below 85%
# lib.rs/main.rs/menu.rs are Tauri boilerplate -- not meaningfully unit-testable.
- name: Upload Rust coverage to Codecov
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
uses: codecov/codecov-action@5975040f7f7d40edaff8d784b576fd65ae95c073
with:
use_oidc: true
fail_ci_if_error: true
disable_search: true
files: ./coverage/rust.lcov
flags: rust
verbose: true
# OIDC avoids long-lived CODECOV_TOKEN secrets.
- name: Clippy (Rust)
run: cargo clippy --manifest-path=src-tauri/Cargo.toml -- -D warnings
- name: Format check (Rust)
run: cargo fmt --manifest-path=src-tauri/Cargo.toml -- --check
linux-build:
name: Linux build verification
# Keep the normal push CI lane under the 10-minute target. The release
# workflows already perform the full Linux/AppImage build after main
# pushes, so this slower compatibility check stays available for PRs and
# manual diagnostics without blocking every direct push.
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Tauri Linux system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libsoup-3.0-dev \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
libfuse2 \
librsvg2-dev \
patchelf \
build-essential \
file
- name: Setup pnpm
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8
with:
components: clippy
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
src-tauri/target
key: ${{ runner.os }}-cargo-${{ env.RUST_TARGET_CACHE_VERSION }}-${{ hashFiles('src-tauri/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ env.RUST_TARGET_CACHE_VERSION }}-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Frontend build
run: pnpm build
- name: Cargo check
run: cargo check --manifest-path=src-tauri/Cargo.toml
- name: Clippy
run: cargo clippy --manifest-path=src-tauri/Cargo.toml -- -D warnings

View file

@ -0,0 +1,104 @@
name: Deploy docs
on:
push:
branches: [main]
paths:
- ".github/workflows/deploy-docs.yml"
- "package.json"
- "pnpm-lock.yaml"
- "scripts/build-agent-docs.mjs"
- "site/**"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
env:
NODE_OPTIONS: --max-old-space-size=4096
jobs:
build:
name: Build VitePress site
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: pnpm
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6
with:
bun-version: latest
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build docs and download pages
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pnpm docs:build
DIST="site/.vitepress/dist"
mkdir -p "$DIST/alpha" "$DIST/stable" "$DIST/download" "$DIST/releases" "$DIST/stable/download"
gh api -H "Accept: application/vnd.github.html+json" repos/${{ github.repository }}/releases --paginate > "$DIST/releases.json"
STABLE_TAG="$(gh release list --repo ${{ github.repository }} --limit 100 --json tagName,isDraft,isPrerelease --jq '[.[] | select(.isDraft == false and .isPrerelease == false)][0].tagName // ""')"
if [ -n "$STABLE_TAG" ]; then
gh release download --repo ${{ github.repository }} "$STABLE_TAG" --pattern "stable-latest.json" --output "$DIST/stable/latest.json" || echo '{}' > "$DIST/stable/latest.json"
else
echo '{}' > "$DIST/stable/latest.json"
fi
ALPHA_TAG="$(gh release list --repo ${{ github.repository }} --limit 100 --json tagName,isDraft,isPrerelease --jq '[.[] | select(.isDraft == false and .isPrerelease == true)][0].tagName // ""')"
if [ -n "$ALPHA_TAG" ]; then
gh release download --repo ${{ github.repository }} "$ALPHA_TAG" --pattern "alpha-latest.json" --output "$DIST/alpha/latest.json" || echo '{}' > "$DIST/alpha/latest.json"
else
echo '{}' > "$DIST/alpha/latest.json"
fi
bun scripts/build-release-download-page.ts --latest-json "$DIST/stable/latest.json" --releases-json "$DIST/releases.json" --output-file "$DIST/download/index.html"
bun scripts/build-release-history-page.ts --releases-json "$DIST/releases.json" --output-file "$DIST/releases/index.html"
cp "$DIST/download/index.html" "$DIST/stable/download/index.html"
cp "$DIST/alpha/latest.json" "$DIST/latest.json"
cp "$DIST/alpha/latest.json" "$DIST/latest-canary.json"
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: site/.vitepress/dist
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-24.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4

View file

@ -0,0 +1,619 @@
name: Release build artifacts
on:
workflow_call:
inputs:
version:
required: true
type: string
macos_bundles:
required: false
type: string
default: ""
upload_macos_dmg:
required: true
type: boolean
env:
# Bump this when Tauri/Rust target artifacts capture stale absolute paths.
RUST_TARGET_CACHE_VERSION: v2026-04-14-tolaria
# The production Vite bundle can exceed Node's default ~2GB heap on
# macOS arm64 runners while Tauri runs beforeBuildCommand.
NODE_OPTIONS: --max-old-space-size=4096
jobs:
build:
name: Build (${{ matrix.arch }})
runs-on: macos-15
strategy:
fail-fast: true
matrix:
include:
- arch: aarch64
target: aarch64-apple-darwin
- arch: x86_64
target: x86_64-apple-darwin
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
- name: Setup Bun (required for bundle-qmd.sh)
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6
with:
bun-version: latest
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8
with:
targets: ${{ matrix.target }}
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
src-tauri/target
key: ${{ runner.os }}-release-cargo-${{ matrix.target }}-${{ env.RUST_TARGET_CACHE_VERSION }}-${{ hashFiles('src-tauri/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-release-cargo-${{ matrix.target }}-${{ env.RUST_TARGET_CACHE_VERSION }}-
- name: Install frontend dependencies
run: pnpm install --frozen-lockfile
- name: Clear cached bundle artifacts
run: |
rm -rf src-tauri/target/${{ matrix.target }}/release/bundle
- name: Set version
run: |
VERSION="${{ inputs.version }}"
jq --arg v "$VERSION" '.version = $v' src-tauri/tauri.conf.json > tmp.json && mv tmp.json src-tauri/tauri.conf.json
sed -i '' "s/^version = \".*\"/version = \"$VERSION\"/" src-tauri/Cargo.toml
- name: Import Apple Developer certificate into keychain
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
run: |
CERT_PATH="$RUNNER_TEMP/apple_cert.p12"
KEYCHAIN_PATH="$RUNNER_TEMP/laputa-signing.keychain-db"
KEYCHAIN_PASSWORD="$(uuidgen)"
echo "$APPLE_CERTIFICATE" | base64 --decode > "$CERT_PATH"
security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH"
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
security import "$CERT_PATH" -P "$APPLE_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH"
security list-keychain -d user -s "$KEYCHAIN_PATH"
security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
echo "KEYCHAIN_PATH=$KEYCHAIN_PATH" >> "$GITHUB_ENV"
- name: Validate telemetry env
env:
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
VITE_POSTHOG_KEY: ${{ secrets.VITE_POSTHOG_KEY }}
VITE_POSTHOG_HOST: ${{ secrets.VITE_POSTHOG_HOST }}
run: |
python3 <<'PY'
import os
import re
import sys
from urllib.parse import urlparse
DISALLOWED_PLACEHOLDERS = {
"",
"-",
"_",
"false",
"true",
"null",
"undefined",
"none",
"disabled",
}
def normalize(name: str) -> str:
value = os.getenv(name, "").strip()
if len(value) >= 2 and value[0] == value[-1] and value[0] in ("'", '"'):
value = value[1:-1].strip()
return value
def normalize_http_like(value: str) -> str:
if "://" in value:
return value
return f"https://{value}"
def normalize_hostname(hostname: str) -> str:
normalized = hostname.strip().rstrip('.').lower()
if normalized.startswith('[') and normalized.endswith(']'):
normalized = normalized[1:-1]
return normalized
def is_ip_address(hostname: str) -> bool:
if re.fullmatch(r"(?:\d{1,3}\.){3}\d{1,3}", hostname):
return all(0 <= int(part) <= 255 for part in hostname.split('.'))
return ':' in hostname and re.fullmatch(r"[\da-f:]+", hostname, re.IGNORECASE) is not None
def is_allowed_hostname(hostname: str) -> bool:
normalized = normalize_hostname(hostname)
if not normalized or normalized in DISALLOWED_PLACEHOLDERS:
return False
if normalized == 'localhost':
return True
return '.' in normalized or is_ip_address(normalized)
def is_http_url(value: str) -> bool:
parsed = urlparse(normalize_http_like(value))
return parsed.scheme in {"http", "https"} and is_allowed_hostname(parsed.hostname or "")
values = {
name: normalize(name)
for name in (
"VITE_SENTRY_DSN",
"SENTRY_DSN",
"VITE_POSTHOG_KEY",
"VITE_POSTHOG_HOST",
)
}
errors = []
for name in ("VITE_SENTRY_DSN", "SENTRY_DSN", "VITE_POSTHOG_HOST"):
value = values[name]
if value.lower() in DISALLOWED_PLACEHOLDERS:
errors.append(f"{name} must be set to a real value, not a placeholder")
elif not is_http_url(value):
errors.append(f"{name} must be a valid http(s) URL with a non-placeholder host")
if values["VITE_POSTHOG_KEY"].lower() in DISALLOWED_PLACEHOLDERS:
errors.append("VITE_POSTHOG_KEY must be set to a real project API key, not a placeholder")
if errors:
print("Telemetry env validation failed:", file=sys.stderr)
for error in errors:
print(f"- {error}", file=sys.stderr)
raise SystemExit(1)
print("Telemetry env validation passed.")
PY
- name: Build Tauri app (with signing + notarization)
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
VITE_SENTRY_RELEASE: ${{ inputs.version }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
VITE_POSTHOG_KEY: ${{ secrets.VITE_POSTHOG_KEY }}
VITE_POSTHOG_HOST: ${{ secrets.VITE_POSTHOG_HOST }}
run: |
MACOS_BUNDLES="${{ inputs.macos_bundles }}"
if [ -n "$MACOS_BUNDLES" ]; then
pnpm tauri build --target ${{ matrix.target }} --bundles "$MACOS_BUNDLES"
else
pnpm tauri build --target ${{ matrix.target }}
fi
- name: Upload .dmg
if: ${{ inputs.upload_macos_dmg }}
uses: actions/upload-artifact@v4
with:
name: dmg-${{ matrix.arch }}
path: src-tauri/target/${{ matrix.target }}/release/bundle/dmg/*.dmg
retention-days: 1
- name: Upload updater artifacts (.tar.gz + .sig)
uses: actions/upload-artifact@v4
with:
name: updater-${{ matrix.arch }}
path: |
src-tauri/target/${{ matrix.target }}/release/bundle/macos/*.app.tar.gz
src-tauri/target/${{ matrix.target }}/release/bundle/macos/*.app.tar.gz.sig
retention-days: 1
build-linux:
name: Build (linux-x86_64)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Tauri Linux system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libsoup-3.0-dev \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
fcitx5-frontend-gtk3 \
libfuse2 \
librsvg2-dev \
curl \
wget \
patchelf \
build-essential \
file \
cpio \
rpm
- name: Setup pnpm
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8
with:
targets: x86_64-unknown-linux-gnu
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
src-tauri/target
key: ${{ runner.os }}-release-cargo-x86_64-unknown-linux-gnu-${{ env.RUST_TARGET_CACHE_VERSION }}-${{ hashFiles('src-tauri/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-release-cargo-x86_64-unknown-linux-gnu-${{ env.RUST_TARGET_CACHE_VERSION }}-
- name: Install frontend dependencies
run: pnpm install --frozen-lockfile
- name: Clear cached bundle artifacts
run: |
rm -rf src-tauri/target/x86_64-unknown-linux-gnu/release/bundle
- name: Set version
run: |
VERSION="${{ inputs.version }}"
jq --arg v "$VERSION" '.version = $v' src-tauri/tauri.conf.json > tmp.json && mv tmp.json src-tauri/tauri.conf.json
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" src-tauri/Cargo.toml
- name: Build Tauri app (Linux bundles)
env:
APPIMAGE_EXTRACT_AND_RUN: 1
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
VITE_SENTRY_RELEASE: ${{ inputs.version }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
VITE_POSTHOG_KEY: ${{ secrets.VITE_POSTHOG_KEY }}
VITE_POSTHOG_HOST: ${{ secrets.VITE_POSTHOG_HOST }}
run: |
pnpm tauri build --target x86_64-unknown-linux-gnu --bundles deb,rpm,appimage
- name: Validate Linux bundles
run: |
shopt -s nullglob
appimages=(
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage
)
installers=(
"${appimages[@]}"
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/rpm/*.rpm
)
signatures=(
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage.sig
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage.tar.gz.sig
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb.sig
)
if [ ${#appimages[@]} -eq 0 ]; then
echo "::error::Linux build produced no AppImage bundle."
exit 1
fi
if [ ${#installers[@]} -eq 0 ]; then
echo "::error::Linux build produced no AppImage, deb or rpm bundle."
exit 1
fi
if [ ${#signatures[@]} -eq 0 ]; then
echo "::error::Linux build produced no updater signature (.sig) artifact."
exit 1
fi
validate_desktop_categories() {
local package_path="$1"
local extract_dir="$2"
rm -rf "$extract_dir"
mkdir -p "$extract_dir"
case "$package_path" in
*.deb)
dpkg-deb -x "$package_path" "$extract_dir"
;;
*.rpm)
(
cd "$extract_dir"
rpm2cpio "$GITHUB_WORKSPACE/$package_path" | cpio -id --quiet
)
;;
*)
echo "::error::Unsupported package format for desktop entry validation: $package_path"
exit 1
;;
esac
mapfile -t desktop_files < <(find "$extract_dir/usr/share/applications" -type f -name "*.desktop" 2>/dev/null)
if [ ${#desktop_files[@]} -eq 0 ]; then
echo "::error::$package_path did not include a desktop entry under /usr/share/applications."
exit 1
fi
for desktop_file in "${desktop_files[@]}"; do
local categories
categories=$(grep "^Categories=" "$desktop_file" | cut -d= -f2- || true)
if [ -z "$categories" ]; then
echo "::error::$package_path has an empty Categories field in $(basename "$desktop_file")."
exit 1
fi
if [[ "$categories" != *";" ]]; then
echo "::error::$package_path has a Categories field that is not semicolon-terminated: $categories"
exit 1
fi
case ";$categories" in
*";Office;"*|*";Utility;"*)
;;
*)
echo "::error::$package_path has an unexpected launcher category: $categories"
exit 1
;;
esac
done
}
for deb in src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb; do
validate_desktop_categories "$deb" "$RUNNER_TEMP/tolaria-deb-desktop"
done
for rpm_package in src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/rpm/*.rpm; do
validate_desktop_categories "$rpm_package" "$RUNNER_TEMP/tolaria-rpm-desktop"
done
- name: Upload Linux bundles
uses: actions/upload-artifact@v4
with:
name: linux-x86_64-bundles
path: |
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb.sig
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/rpm/*.rpm
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage.sig
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage.tar.gz
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage.tar.gz.sig
if-no-files-found: error
retention-days: 1
build-windows:
name: Build (windows-x86_64)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8
with:
targets: x86_64-pc-windows-msvc
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~\.cargo\registry
~\.cargo\git
src-tauri\target
key: ${{ runner.os }}-release-cargo-x86_64-pc-windows-msvc-${{ env.RUST_TARGET_CACHE_VERSION }}-${{ hashFiles('src-tauri/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-release-cargo-x86_64-pc-windows-msvc-${{ env.RUST_TARGET_CACHE_VERSION }}-
- name: Cache Tauri Windows tools
uses: actions/cache@v4
with:
path: ~\AppData\Local\tauri
key: ${{ runner.os }}-tauri-tools-nsis-3.11-nsis-tauri-utils-0.5.3
- name: Prefetch Tauri NSIS toolchain
shell: pwsh
run: ./.github/scripts/prefetch-tauri-nsis.ps1
- name: Install frontend dependencies
run: pnpm install --frozen-lockfile
- name: Clear cached Windows bundle artifacts
shell: pwsh
run: |
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "src-tauri/target/x86_64-pc-windows-msvc/release/bundle"
- name: Set version
shell: pwsh
run: |
$version = "${{ inputs.version }}"
$tauri = Get-Content "src-tauri/tauri.conf.json" | ConvertFrom-Json
$tauri.version = $version
$tauri | ConvertTo-Json -Depth 100 | Set-Content "src-tauri/tauri.conf.json"
(Get-Content "src-tauri/Cargo.toml") -replace '^version = ".*"$', "version = `"$version`"" | Set-Content "src-tauri/Cargo.toml"
- name: Validate Windows release env
id: windows-signing
shell: bash
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
WINDOWS_CODE_SIGNING_CERTIFICATE: ${{ secrets.WINDOWS_CODE_SIGNING_CERTIFICATE }}
WINDOWS_CODE_SIGNING_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CODE_SIGNING_CERTIFICATE_PASSWORD }}
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
run: |
for name in TAURI_SIGNING_PRIVATE_KEY TAURI_KEY_PASSWORD; do
if [ -z "${!name}" ]; then
echo "::error::$name is required to build signed Windows updater artifacts."
exit 1
fi
done
has_certificate=false
has_password=false
if [ -n "$WINDOWS_CODE_SIGNING_CERTIFICATE" ] || [ -n "$WINDOWS_CERTIFICATE" ]; then
has_certificate=true
fi
if [ -n "$WINDOWS_CODE_SIGNING_CERTIFICATE_PASSWORD" ] || [ -n "$WINDOWS_CERTIFICATE_PASSWORD" ]; then
has_password=true
fi
if [ "$has_certificate" != "$has_password" ]; then
echo "::error::Windows Authenticode signing is partially configured. Set both certificate and password secrets, or remove both to build with Tauri updater signatures only."
exit 1
fi
if [ "$has_certificate" = "true" ]; then
echo "authenticode_available=true" >> "$GITHUB_OUTPUT"
else
echo "::warning::Windows Authenticode certificate secrets are not configured. Building Windows artifacts without Authenticode signatures; Tauri updater signatures are still required."
echo "authenticode_available=false" >> "$GITHUB_OUTPUT"
fi
- name: Prepare Windows Authenticode signing
if: ${{ steps.windows-signing.outputs.authenticode_available == 'true' }}
shell: pwsh
env:
WINDOWS_CODE_SIGNING_CERTIFICATE: ${{ secrets.WINDOWS_CODE_SIGNING_CERTIFICATE }}
WINDOWS_CODE_SIGNING_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CODE_SIGNING_CERTIFICATE_PASSWORD }}
WINDOWS_CODE_SIGNING_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CODE_SIGNING_CERTIFICATE_THUMBPRINT }}
WINDOWS_CODE_SIGNING_TIMESTAMP_URL: ${{ secrets.WINDOWS_CODE_SIGNING_TIMESTAMP_URL }}
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
WINDOWS_TIMESTAMP_URL: ${{ secrets.WINDOWS_TIMESTAMP_URL }}
run: ./.github/scripts/configure-windows-authenticode.ps1
- name: Build Tauri app (Windows bundles)
shell: pwsh
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
VITE_SENTRY_RELEASE: ${{ inputs.version }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
VITE_POSTHOG_KEY: ${{ secrets.VITE_POSTHOG_KEY }}
VITE_POSTHOG_HOST: ${{ secrets.VITE_POSTHOG_HOST }}
run: |
if ("${{ steps.windows-signing.outputs.authenticode_available }}" -eq "true") {
pnpm tauri build --target x86_64-pc-windows-msvc --bundles nsis --config src-tauri/tauri.windows-signing.conf.json
} else {
pnpm tauri build --target x86_64-pc-windows-msvc --bundles nsis
}
- name: Validate Windows Authenticode signatures
if: ${{ steps.windows-signing.outputs.authenticode_available == 'true' }}
shell: pwsh
run: |
$expectedThumbprint = $env:WINDOWS_CODE_SIGNING_CERTIFICATE_THUMBPRINT
if ([string]::IsNullOrWhiteSpace($expectedThumbprint)) {
throw "WINDOWS_CODE_SIGNING_CERTIFICATE_THUMBPRINT was not exported by the signing setup step."
}
$expectedThumbprint = ($expectedThumbprint -replace "\s", "").ToUpperInvariant()
$paths = @()
$paths += Get-ChildItem -Path "src-tauri/target/x86_64-pc-windows-msvc/release" -Filter "*.exe" -File -ErrorAction SilentlyContinue
$paths += Get-ChildItem -Path "src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis" -Filter "*.exe" -File -ErrorAction SilentlyContinue
$paths += Get-ChildItem -Path "src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi" -Filter "*.msi" -File -ErrorAction SilentlyContinue
$paths = @($paths | Sort-Object FullName -Unique)
if ($paths.Count -eq 0) {
throw "No Windows executable or installer artifacts found to verify."
}
foreach ($path in $paths) {
$signature = Get-AuthenticodeSignature -FilePath $path.FullName
if ($signature.Status -ne "Valid") {
throw "Invalid Authenticode signature for $($path.FullName): $($signature.Status)"
}
if ($null -eq $signature.SignerCertificate) {
throw "Missing signer certificate for $($path.FullName)."
}
$actualThumbprint = ($signature.SignerCertificate.Thumbprint -replace "\s", "").ToUpperInvariant()
if ($actualThumbprint -ne $expectedThumbprint) {
throw "Unexpected signer thumbprint for $($path.FullName): $actualThumbprint"
}
Write-Host "Authenticode signature OK: $($path.FullName)"
}
- name: Validate Windows bundles
shell: bash
run: |
shopt -s nullglob
installers=(
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*-setup.exe
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi
)
signatures=(
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*-setup.exe.sig
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.nsis.zip.sig
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi.sig
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi.zip.sig
)
if [ ${#installers[@]} -eq 0 ]; then
echo "::error::Windows build produced no installable NSIS or MSI bundle."
exit 1
fi
for installer in "${installers[@]}"; do
if [[ "$(basename "$installer")" != *"${{ inputs.version }}"* ]]; then
echo "::error::Windows build produced an installer for a different version: $(basename "$installer")"
exit 1
fi
done
if [ ${#signatures[@]} -eq 0 ]; then
echo "::error::Windows build produced no updater signature (.sig) artifact."
exit 1
fi
- name: Upload Windows bundles
uses: actions/upload-artifact@v4
with:
name: windows-x86_64-bundles
path: |
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe.sig
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.zip
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.zip.sig
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi.sig
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.zip
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.zip.sig
if-no-files-found: error
retention-days: 1

View file

@ -0,0 +1,300 @@
name: Release (Stable)
on:
push:
tags:
- 'stable-v*'
- 'v20*'
concurrency:
group: release-stable-${{ github.ref }}
cancel-in-progress: true
jobs:
# ─────────────────────────────────────────────────────────────
# Phase 1: Compute the stable version string once
# ─────────────────────────────────────────────────────────────
version:
name: Compute stable version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.ver.outputs.version }}
display_version: ${{ steps.ver.outputs.display_version }}
tag: ${{ steps.ver.outputs.tag }}
steps:
- id: ver
shell: bash
run: |
python3 <<'PY' > version.env
import os
import re
from datetime import date
tag = os.environ["GITHUB_REF_NAME"]
legacy_match = re.fullmatch(r"stable-v(\d{4})\.(\d{1,2})\.(\d{1,2})", tag)
date_match = re.fullmatch(r"v(\d{4})-(\d{2})-(\d{2})", tag)
if date_match:
year, month, day = map(int, date_match.groups())
date(year, month, day)
version = f"{year}.{month}.{day}"
display_version = tag
elif legacy_match:
year, month, day = map(int, legacy_match.groups())
date(year, month, day)
version = f"{year}.{month}.{day}"
display_version = version
else:
raise SystemExit(f"Stable tags must use vYYYY-MM-DD or stable-vYYYY.M.D, got {tag}")
print(f"version={version}")
print(f"display_version={display_version}")
print(f"tag={tag}")
PY
cat version.env >> "$GITHUB_OUTPUT"
DISPLAY_VERSION=$(grep '^display_version=' version.env | cut -d= -f2-)
echo "### Stable version: \`$DISPLAY_VERSION\`" >> "$GITHUB_STEP_SUMMARY"
# -------------------------------------------------------------
# Phase 2: Build shared release artifacts
# -------------------------------------------------------------
build-artifacts:
name: Build release artifacts
needs: version
uses: ./.github/workflows/release-build-artifacts.yml
with:
version: ${{ needs.version.outputs.version }}
macos_bundles: ""
upload_macos_dmg: true
secrets: inherit
# ─────────────────────────────────────────────────────────────
# Phase 3: Publish GitHub Release
# ─────────────────────────────────────────────────────────────
release:
name: GitHub Release (stable)
needs: [version, build-artifacts]
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Normalize macOS release artifact names
run: |
normalize_macos_artifacts() {
local arch="$1"
local normalized_updater="$2"
local normalized_dmg="$3"
local updater_dir="updater-${arch}"
local updater_file
updater_file=$(find "$updater_dir" -maxdepth 1 -name "*.app.tar.gz" -print -quit)
if [ -z "$updater_file" ]; then
echo "::error::Missing macOS updater artifact in ${updater_dir}" >&2
return 1
fi
local sig_file="${updater_file}.sig"
if [ ! -f "$sig_file" ]; then
echo "::error::Missing macOS updater signature for ${updater_file}" >&2
return 1
fi
local normalized_sig="${normalized_updater}.sig"
if [ "$updater_file" != "$normalized_updater" ]; then
mv "$updater_file" "$normalized_updater"
fi
if [ "$sig_file" != "$normalized_sig" ]; then
mv "$sig_file" "$normalized_sig"
fi
local dmg_dir="dmg-${arch}"
local dmg_file
dmg_file=$(find "$dmg_dir" -maxdepth 1 -name "*.dmg" -print -quit)
if [ -z "$dmg_file" ]; then
echo "::error::Missing macOS DMG artifact in ${dmg_dir}" >&2
return 1
fi
if [ "$dmg_file" != "$normalized_dmg" ]; then
mv "$dmg_file" "$normalized_dmg"
fi
}
normalize_macos_artifacts aarch64 \
"updater-aarch64/Tolaria_${{ needs.version.outputs.version }}_macOS_Silicon.app.tar.gz" \
"dmg-aarch64/Tolaria_${{ needs.version.outputs.version }}_macOS_Silicon.dmg"
normalize_macos_artifacts x86_64 \
"updater-x86_64/Tolaria_${{ needs.version.outputs.version }}_macOS_Intel.app.tar.gz" \
"dmg-x86_64/Tolaria_${{ needs.version.outputs.version }}_macOS_Intel.dmg"
- name: Generate release notes
run: |
NOTES_FILE="release-notes/${{ needs.version.outputs.tag }}.md"
if [ -f "$NOTES_FILE" ]; then
cat "$NOTES_FILE" > release_notes.md
else
PREV_TAG=$(git for-each-ref --sort=-creatordate --format='%(refname:short)' refs/tags/v20* refs/tags/stable-v* | grep -vx "${{ needs.version.outputs.tag }}" | head -n 1 || echo "")
if [ -z "$PREV_TAG" ]; then
NOTES=$(git log --oneline --no-merges -20)
else
NOTES=$(git log --oneline --no-merges "${PREV_TAG}..${{ needs.version.outputs.tag }}")
fi
{
echo "## What's Changed"
echo ""
echo "$NOTES" | while IFS= read -r line; do echo "- $line"; done
} > release_notes.md
fi
{
echo ""
echo "---"
echo "**Stable release — manually promoted from \`main\`**"
echo ""
echo "**Includes macOS (Apple Silicon and Intel), Windows x64, and Linux x64 bundles**"
echo ""
echo "*Built from \`$(git rev-parse --short ${{ needs.version.outputs.tag }})\` on $(date -u +%Y-%m-%d)*"
} >> release_notes.md
- name: Build stable-latest.json
run: |
VERSION="${{ needs.version.outputs.version }}"
TAG="${{ needs.version.outputs.tag }}"
REPO="${GITHUB_REPOSITORY}"
REPO_NAME="${REPO#*/}"
PAGES_URL="https://refactoringhq.github.io/${REPO_NAME}/"
find_required() {
local patterns=("$@")
for pattern in "${patterns[@]}"; do
set -- $pattern
if [ -e "$1" ]; then
printf '%s\n' "$1"
return 0
fi
done
echo "::error::Missing required artifact matching one of: ${patterns[*]}" >&2
return 1
}
ARM_SIG_FILE=$(find_required "updater-aarch64/*.app.tar.gz.sig")
ARM_UPDATER_FILE="${ARM_SIG_FILE%.sig}"
ARM_SIG=$(cat "$ARM_SIG_FILE")
ARM_TARBALL=$(basename "$ARM_UPDATER_FILE")
ARM_DMG=$(basename "$(find_required "dmg-aarch64/*.dmg")")
INTEL_SIG_FILE=$(find_required "updater-x86_64/*.app.tar.gz.sig")
INTEL_UPDATER_FILE="${INTEL_SIG_FILE%.sig}"
INTEL_SIG=$(cat "$INTEL_SIG_FILE")
INTEL_TARBALL=$(basename "$INTEL_UPDATER_FILE")
INTEL_DMG=$(basename "$(find_required "dmg-x86_64/*.dmg")")
LINUX_SIG_FILE=$(find_required "linux-x86_64-bundles/*/*.AppImage.sig" "linux-x86_64-bundles/*/*.AppImage.tar.gz.sig" "linux-x86_64-bundles/*/*.deb.sig" "linux-x86_64-bundles/*.AppImage.sig" "linux-x86_64-bundles/*.AppImage.tar.gz.sig" "linux-x86_64-bundles/*.deb.sig")
LINUX_UPDATER_FILE="${LINUX_SIG_FILE%.sig}"
LINUX_SIG=$(cat "$LINUX_SIG_FILE")
LINUX_UPDATER=$(basename "$LINUX_UPDATER_FILE")
LINUX_DOWNLOAD=$(basename "$(find_required "linux-x86_64-bundles/*/*.AppImage" "linux-x86_64-bundles/*/*.deb" "linux-x86_64-bundles/*/*.AppImage.tar.gz" "linux-x86_64-bundles/*.AppImage" "linux-x86_64-bundles/*.deb" "linux-x86_64-bundles/*.AppImage.tar.gz")")
WINDOWS_SIG_FILE=$(find_required "windows-x86_64-bundles/*/*-setup.exe.sig" "windows-x86_64-bundles/*/*.msi.sig" "windows-x86_64-bundles/*/*.nsis.zip.sig" "windows-x86_64-bundles/*/*.msi.zip.sig" "windows-x86_64-bundles/*-setup.exe.sig" "windows-x86_64-bundles/*.msi.sig" "windows-x86_64-bundles/*.nsis.zip.sig" "windows-x86_64-bundles/*.msi.zip.sig")
WINDOWS_UPDATER_FILE="${WINDOWS_SIG_FILE%.sig}"
WINDOWS_SIG=$(cat "$WINDOWS_SIG_FILE")
WINDOWS_UPDATER=$(basename "$WINDOWS_UPDATER_FILE")
WINDOWS_DOWNLOAD=$(basename "$(find_required "windows-x86_64-bundles/*/*-setup.exe" "windows-x86_64-bundles/*/*.msi" "windows-x86_64-bundles/*/*.nsis.zip" "windows-x86_64-bundles/*/*.msi.zip" "windows-x86_64-bundles/*-setup.exe" "windows-x86_64-bundles/*.msi" "windows-x86_64-bundles/*.nsis.zip" "windows-x86_64-bundles/*.msi.zip")")
cat > stable-latest.json << EOF
{
"version": "${VERSION}",
"notes": "Stable release. See ${PAGES_URL} for full release notes.",
"pub_date": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"platforms": {
"darwin-aarch64": {
"signature": "${ARM_SIG}",
"url": "https://github.com/${REPO}/releases/download/${TAG}/${ARM_TARBALL}",
"dmg_url": "https://github.com/${REPO}/releases/download/${TAG}/${ARM_DMG}"
},
"darwin-x86_64": {
"signature": "${INTEL_SIG}",
"url": "https://github.com/${REPO}/releases/download/${TAG}/${INTEL_TARBALL}",
"dmg_url": "https://github.com/${REPO}/releases/download/${TAG}/${INTEL_DMG}"
},
"linux-x86_64": {
"signature": "${LINUX_SIG}",
"url": "https://github.com/${REPO}/releases/download/${TAG}/${LINUX_UPDATER}",
"download_url": "https://github.com/${REPO}/releases/download/${TAG}/${LINUX_DOWNLOAD}"
},
"windows-x86_64": {
"signature": "${WINDOWS_SIG}",
"url": "https://github.com/${REPO}/releases/download/${TAG}/${WINDOWS_UPDATER}",
"download_url": "https://github.com/${REPO}/releases/download/${TAG}/${WINDOWS_DOWNLOAD}"
}
}
}
EOF
echo "stable-latest.json:"; cat stable-latest.json
- name: Publish GitHub Release
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65
with:
tag_name: ${{ needs.version.outputs.tag }}
name: Tolaria ${{ needs.version.outputs.display_version }}
body_path: release_notes.md
draft: false
prerelease: false
files: |
dmg-aarch64/*.dmg
updater-aarch64/*.app.tar.gz
updater-aarch64/*.app.tar.gz.sig
dmg-x86_64/*.dmg
updater-x86_64/*.app.tar.gz
updater-x86_64/*.app.tar.gz.sig
linux-x86_64-bundles/*.deb
linux-x86_64-bundles/*.deb.sig
linux-x86_64-bundles/*.rpm
linux-x86_64-bundles/*.AppImage
linux-x86_64-bundles/*.AppImage.sig
linux-x86_64-bundles/*.AppImage.tar.gz
linux-x86_64-bundles/*.AppImage.tar.gz.sig
linux-x86_64-bundles/*/*.deb
linux-x86_64-bundles/*/*.deb.sig
linux-x86_64-bundles/*/*.rpm
linux-x86_64-bundles/*/*.AppImage
linux-x86_64-bundles/*/*.AppImage.sig
linux-x86_64-bundles/*/*.AppImage.tar.gz
linux-x86_64-bundles/*/*.AppImage.tar.gz.sig
windows-x86_64-bundles/*.exe
windows-x86_64-bundles/*.exe.sig
windows-x86_64-bundles/*.msi
windows-x86_64-bundles/*.msi.sig
windows-x86_64-bundles/*.zip
windows-x86_64-bundles/*.zip.sig
windows-x86_64-bundles/*/*.exe
windows-x86_64-bundles/*/*.exe.sig
windows-x86_64-bundles/*/*.msi
windows-x86_64-bundles/*/*.msi.sig
windows-x86_64-bundles/*/*.zip
windows-x86_64-bundles/*/*.zip.sig
stable-latest.json
# ─────────────────────────────────────────────────────────────
# Phase 4: Trigger the main-branch GitHub Pages deployment
# ─────────────────────────────────────────────────────────────
pages:
name: Update docs and release pages
needs: [version, release]
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Dispatch docs deployment from main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh workflow run deploy-docs.yml --repo ${{ github.repository }} --ref main
echo "Triggered deploy-docs.yml on main after publishing ${{ needs.version.outputs.tag }}."

View file

@ -0,0 +1,410 @@
name: Release (Alpha)
on:
push:
branches:
- main
paths-ignore:
- ".husky/**"
- ".github/workflows/deploy-docs.yml"
- ".github/workflows/release.yml"
- "site/**"
concurrency:
group: release-alpha-${{ github.ref }}
cancel-in-progress: true
jobs:
# ─────────────────────────────────────────────────────────────
# Phase 1: Compute the alpha version string once
# Alpha builds use calendar semver and stay newer than the latest stable tag.
# ─────────────────────────────────────────────────────────────
version:
name: Compute alpha version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.ver.outputs.version }}
display_version: ${{ steps.ver.outputs.display_version }}
tag: ${{ steps.ver.outputs.tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: ver
shell: bash
run: |
python3 <<'PY' > version.env
import re
import subprocess
from datetime import datetime, timedelta, timezone
def lines(command: list[str]) -> list[str]:
output = subprocess.check_output(command, text=True).strip()
return [line for line in output.splitlines() if line]
alpha_pattern = re.compile(r"^alpha-v(\d{4}\.\d{1,2}\.\d{1,2})-alpha\.(\d+)$")
def parse_alpha_tag(tag: str) -> tuple[str, int] | None:
match = alpha_pattern.fullmatch(tag)
if not match:
return None
calendar_version, sequence = match.groups()
return calendar_version, int(sequence)
def alpha_version(calendar_version: str, sequence: int) -> str:
return f"{calendar_version}-alpha.{sequence}"
def alpha_tag(calendar_version: str, sequence: int) -> str:
return f"alpha-v{calendar_version}-alpha.{sequence:04d}"
existing_tags = [
tag for tag in lines(["git", "tag", "--points-at", "HEAD"])
if tag.startswith("alpha-v")
]
if existing_tags:
tag = existing_tags[0]
parsed = parse_alpha_tag(tag)
version = alpha_version(*parsed) if parsed is not None else tag.removeprefix("alpha-v")
else:
today = datetime.now(timezone.utc).date()
stable_date = None
stable_patterns = (
re.compile(r"^v(\d{4})-(\d{2})-(\d{2})$"),
re.compile(r"^stable-v(\d{4})\.(\d{1,2})\.(\d{1,2})$"),
)
stable_tags = lines([
"git", "for-each-ref", "--sort=-creatordate", "--format=%(refname:short)",
"refs/tags/v20*", "refs/tags/stable-v*",
])
for stable_tag in stable_tags:
match = next((pattern.fullmatch(stable_tag) for pattern in stable_patterns if pattern.fullmatch(stable_tag)), None)
if not match:
continue
year, month, day = map(int, match.groups())
try:
stable_date = datetime(year, month, day, tzinfo=timezone.utc).date()
except ValueError:
continue
break
alpha_date = today if stable_date is None or today > stable_date else stable_date + timedelta(days=1)
calendar_version = f"{alpha_date.year}.{alpha_date.month}.{alpha_date.day}"
sequence = len(lines(["git", "tag", "--list", f"alpha-v{calendar_version}-alpha.*"])) + 1
version = alpha_version(calendar_version, sequence)
tag = alpha_tag(calendar_version, sequence)
display_match = re.fullmatch(r"(\d{4})\.(\d{1,2})\.(\d{1,2})-alpha\.(\d+)", version)
display_version = (
f"Alpha {int(display_match.group(1))}.{int(display_match.group(2))}.{int(display_match.group(3))}.{int(display_match.group(4))}"
if display_match
else version
)
print(f"version={version}")
print(f"display_version={display_version}")
print(f"tag={tag}")
PY
cat version.env >> "$GITHUB_OUTPUT"
VERSION=$(grep '^version=' version.env | cut -d= -f2-)
DISPLAY_VERSION=$(grep '^display_version=' version.env | cut -d= -f2-)
echo "### Alpha version: \`$DISPLAY_VERSION\` (\`$VERSION\`)" >> "$GITHUB_STEP_SUMMARY"
# -------------------------------------------------------------
# Phase 2: Build shared release artifacts
# -------------------------------------------------------------
build-artifacts:
name: Build release artifacts
needs: version
uses: ./.github/workflows/release-build-artifacts.yml
with:
version: ${{ needs.version.outputs.version }}
macos_bundles: app
upload_macos_dmg: false
secrets: inherit
# ─────────────────────────────────────────────────────────────
# Phase 3: Publish GitHub Release
# No lipo/re-signing — use the per-arch artifacts directly
# ─────────────────────────────────────────────────────────────
release:
name: GitHub Release (alpha)
needs: [version, build-artifacts]
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Normalize macOS updater artifact names
run: |
normalize_updater() {
local arch="$1"
local normalized_updater="$2"
local artifact_dir="updater-${arch}"
local updater_file
updater_file=$(find "$artifact_dir" -maxdepth 1 -name "*.app.tar.gz" -print -quit)
if [ -z "$updater_file" ]; then
echo "::error::Missing macOS updater artifact in ${artifact_dir}" >&2
return 1
fi
local sig_file="${updater_file}.sig"
if [ ! -f "$sig_file" ]; then
echo "::error::Missing macOS updater signature for ${updater_file}" >&2
return 1
fi
local normalized_sig="${normalized_updater}.sig"
if [ "$updater_file" != "$normalized_updater" ]; then
mv "$updater_file" "$normalized_updater"
fi
if [ "$sig_file" != "$normalized_sig" ]; then
mv "$sig_file" "$normalized_sig"
fi
}
normalize_updater aarch64 "updater-aarch64/Tolaria_${{ needs.version.outputs.version }}_macOS_Silicon.app.tar.gz"
normalize_updater x86_64 "updater-x86_64/Tolaria_${{ needs.version.outputs.version }}_macOS_Intel.app.tar.gz"
- name: Generate release notes
run: |
PREV_TAG=$(python3 <<'PY'
import re
import subprocess
current_tag = '${{ needs.version.outputs.tag }}'
pattern = re.compile(r'^alpha-v(\d{4})\.(\d{1,2})\.(\d{1,2})-alpha\.(\d+)$')
output = subprocess.check_output(['git', 'tag', '--list', 'alpha-v*'], text=True).strip()
tags = [line for line in output.splitlines() if line and line != current_tag]
parsed_tags = []
for tag in tags:
match = pattern.fullmatch(tag)
if not match:
continue
year, month, day, sequence = map(int, match.groups())
parsed_tags.append(((year, month, day, sequence), tag))
print(max(parsed_tags)[1] if parsed_tags else '')
PY
)
if [ -z "$PREV_TAG" ]; then
NOTES=$(git log --oneline --no-merges -20)
else
NOTES=$(git log --oneline --no-merges "${PREV_TAG}..HEAD")
fi
{
echo "## What's Changed (Alpha)"
echo ""
echo "$NOTES" | while IFS= read -r line; do echo "- $line"; done
echo ""
echo "---"
echo "**Alpha build — updated on every push to \`main\`**"
echo ""
echo "**Includes macOS (Apple Silicon and Intel), Linux x64, and Windows x64 bundles**"
echo ""
echo "*Built from \`$(git rev-parse --short HEAD)\` on $(date -u +%Y-%m-%d)*"
} > release_notes.md
- name: Build alpha-latest.json
run: |
VERSION="${{ needs.version.outputs.version }}"
TAG="${{ needs.version.outputs.tag }}"
REPO="${GITHUB_REPOSITORY}"
REPO_NAME="${REPO#*/}"
PAGES_URL="https://refactoringhq.github.io/${REPO_NAME}/"
find_required() {
for pattern in "$@"; do
set -- $pattern
if [ -e "$1" ]; then
printf '%s\n' "$1"
return 0
fi
done
return 1
}
ARM_SIG_FILE=$(find_required "updater-aarch64/*.app.tar.gz.sig")
ARM_UPDATER_FILE="${ARM_SIG_FILE%.sig}"
ARM_SIG=$(cat "$ARM_SIG_FILE")
ARM_UPDATER=$(basename "$ARM_UPDATER_FILE")
INTEL_SIG_FILE=$(find_required "updater-x86_64/*.app.tar.gz.sig")
INTEL_UPDATER_FILE="${INTEL_SIG_FILE%.sig}"
INTEL_SIG=$(cat "$INTEL_SIG_FILE")
INTEL_UPDATER=$(basename "$INTEL_UPDATER_FILE")
LINUX_SIG_FILE=$(find_required "linux-x86_64-bundles/*/*.AppImage.sig" "linux-x86_64-bundles/*/*.AppImage.tar.gz.sig" "linux-x86_64-bundles/*/*.deb.sig" "linux-x86_64-bundles/*.AppImage.sig" "linux-x86_64-bundles/*.AppImage.tar.gz.sig" "linux-x86_64-bundles/*.deb.sig")
LINUX_UPDATER_FILE="${LINUX_SIG_FILE%.sig}"
LINUX_SIG=$(cat "$LINUX_SIG_FILE")
LINUX_UPDATER=$(basename "$LINUX_UPDATER_FILE")
LINUX_DOWNLOAD=$(basename "$(find_required "linux-x86_64-bundles/*/*.AppImage" "linux-x86_64-bundles/*/*.deb" "linux-x86_64-bundles/*/*.AppImage.tar.gz" "linux-x86_64-bundles/*.AppImage" "linux-x86_64-bundles/*.deb" "linux-x86_64-bundles/*.AppImage.tar.gz")")
WINDOWS_SIG_FILE=$(find_required "windows-x86_64-bundles/*/*-setup.exe.sig" "windows-x86_64-bundles/*/*.msi.sig" "windows-x86_64-bundles/*/*.nsis.zip.sig" "windows-x86_64-bundles/*/*.msi.zip.sig" "windows-x86_64-bundles/*-setup.exe.sig" "windows-x86_64-bundles/*.msi.sig" "windows-x86_64-bundles/*.nsis.zip.sig" "windows-x86_64-bundles/*.msi.zip.sig")
WINDOWS_UPDATER_FILE="${WINDOWS_SIG_FILE%.sig}"
WINDOWS_SIG=$(cat "$WINDOWS_SIG_FILE")
WINDOWS_UPDATER=$(basename "$WINDOWS_UPDATER_FILE")
WINDOWS_DOWNLOAD=$(basename "$(find_required "windows-x86_64-bundles/*/*-setup.exe" "windows-x86_64-bundles/*/*.msi" "windows-x86_64-bundles/*/*.nsis.zip" "windows-x86_64-bundles/*/*.msi.zip" "windows-x86_64-bundles/*-setup.exe" "windows-x86_64-bundles/*.msi" "windows-x86_64-bundles/*.nsis.zip" "windows-x86_64-bundles/*.msi.zip")")
cat > alpha-latest.json << EOF
{
"version": "${VERSION}",
"notes": "Alpha build. See ${PAGES_URL} for full release notes.",
"pub_date": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"platforms": {
"darwin-aarch64": {
"signature": "${ARM_SIG}",
"url": "https://github.com/${REPO}/releases/download/${TAG}/${ARM_UPDATER}",
"download_url": "https://github.com/${REPO}/releases/download/${TAG}/${ARM_UPDATER}"
},
"darwin-x86_64": {
"signature": "${INTEL_SIG}",
"url": "https://github.com/${REPO}/releases/download/${TAG}/${INTEL_UPDATER}",
"download_url": "https://github.com/${REPO}/releases/download/${TAG}/${INTEL_UPDATER}"
},
"linux-x86_64": {
"signature": "${LINUX_SIG}",
"url": "https://github.com/${REPO}/releases/download/${TAG}/${LINUX_UPDATER}",
"download_url": "https://github.com/${REPO}/releases/download/${TAG}/${LINUX_DOWNLOAD}"
},
"windows-x86_64": {
"signature": "${WINDOWS_SIG}",
"url": "https://github.com/${REPO}/releases/download/${TAG}/${WINDOWS_UPDATER}",
"download_url": "https://github.com/${REPO}/releases/download/${TAG}/${WINDOWS_DOWNLOAD}"
}
}
}
EOF
echo "alpha-latest.json:"; cat alpha-latest.json
- name: Publish GitHub Release
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65
with:
tag_name: ${{ needs.version.outputs.tag }}
name: Tolaria ${{ needs.version.outputs.display_version }}
body_path: release_notes.md
draft: false
prerelease: true
files: |
updater-aarch64/*.app.tar.gz
updater-aarch64/*.app.tar.gz.sig
updater-x86_64/*.app.tar.gz
updater-x86_64/*.app.tar.gz.sig
linux-x86_64-bundles/*.deb
linux-x86_64-bundles/*.deb.sig
linux-x86_64-bundles/*.rpm
linux-x86_64-bundles/*.AppImage
linux-x86_64-bundles/*.AppImage.sig
linux-x86_64-bundles/*.AppImage.tar.gz
linux-x86_64-bundles/*.AppImage.tar.gz.sig
linux-x86_64-bundles/*/*.deb
linux-x86_64-bundles/*/*.deb.sig
linux-x86_64-bundles/*/*.rpm
linux-x86_64-bundles/*/*.AppImage
linux-x86_64-bundles/*/*.AppImage.sig
linux-x86_64-bundles/*/*.AppImage.tar.gz
linux-x86_64-bundles/*/*.AppImage.tar.gz.sig
windows-x86_64-bundles/*.exe
windows-x86_64-bundles/*.exe.sig
windows-x86_64-bundles/*.msi
windows-x86_64-bundles/*.msi.sig
windows-x86_64-bundles/*.zip
windows-x86_64-bundles/*.zip.sig
windows-x86_64-bundles/*/*.exe
windows-x86_64-bundles/*/*.exe.sig
windows-x86_64-bundles/*/*.msi
windows-x86_64-bundles/*/*.msi.sig
windows-x86_64-bundles/*/*.zip
windows-x86_64-bundles/*/*.zip.sig
alpha-latest.json
# ─────────────────────────────────────────────────────────────
# Phase 4: Update GitHub Pages with docs, release history, and download assets
# ─────────────────────────────────────────────────────────────
pages:
name: Update docs and release pages
needs: [version, release]
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
concurrency:
group: github-pages
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6
with:
bun-version: latest
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build docs and release pages
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VITEPRESS_BASE="/" pnpm docs:build
mkdir -p _site/alpha _site/stable _site/release-notes
cp -R site/.vitepress/dist/. _site/
if [ -d release-notes ]; then cp release-notes/*.md _site/release-notes/ 2>/dev/null || true; fi
gh api -H "Accept: application/vnd.github.html+json" repos/${{ github.repository }}/releases --paginate > _site/releases.json
STABLE_TAG=$(gh release list --repo ${{ github.repository }} --exclude-drafts --exclude-pre-releases --limit 1 --json tagName --jq '.[0].tagName // ""')
gh release download --repo ${{ github.repository }} "${{ needs.version.outputs.tag }}" --pattern "alpha-latest.json" --output _site/alpha/latest.json || echo '{}' > _site/alpha/latest.json
if [ -n "$STABLE_TAG" ]; then
gh release download --repo ${{ github.repository }} "$STABLE_TAG" --pattern "stable-latest.json" --output _site/stable/latest.json || echo '{}' > _site/stable/latest.json
else
echo '{}' > _site/stable/latest.json
fi
bun scripts/build-release-download-page.ts --latest-json _site/stable/latest.json --releases-json _site/releases.json --output-file _site/stable/download/index.html
bun scripts/build-release-history-page.ts --releases-json _site/releases.json --output-file _site/releases/index.html
mkdir -p _site/download
cp _site/stable/download/index.html _site/download/index.html
cp _site/alpha/latest.json _site/latest.json
cp _site/alpha/latest.json _site/latest-canary.json
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: ./_site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View file

@ -0,0 +1,81 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
site/.vitepress/cache/
site/.vitepress/dist/
_site/
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# Playwright
/test-results/
/playwright-report/
# Coverage reports
/coverage/
# Demo vault and helper scripts
demo-vault/
generated-fixtures/
select_demo_notes*.py
final_selection.py
# Claude Code task signals
.claude-done
.claude-blocked
src-tauri/target
# Generated mcp-server bundle (built by scripts/bundle-mcp-server.mjs)
src-tauri/resources/mcp-server/
# Python cache
__pycache__/
*.py[cod]
# Dev screenshots
screenshots/
# Stale planning docs (keep locally if needed, not in repo)
REDESIGN-PLAN.md
SF-SYMBOLS-MIGRATION.md
CODE-HEALTH-REPORT.md
# Local home dir artifact from worktree ops
(HOME)/
# Runtime / process files
.claude-pid
# Generated vault index files (qmd/search artifacts)
.laputa-index.json
# Tauri signing keys (never commit private keys)
*.key
*.key.pub
# Local environment variables (never commit)
.env
.env.local
.env.*.local
# Local Codacy CLI runtime/config generated by the MCP server
.codacy/

View file

@ -0,0 +1,55 @@
#!/bin/sh
# Pre-commit: fast local lint gate before commit. Full suite runs in pre-push/CI.
set -e
ensure_node_tooling() {
if command -v node >/dev/null 2>&1 && command -v pnpm >/dev/null 2>&1; then
return 0
fi
NVM_DIR="${NVM_DIR:-$HOME/.nvm}"
if [ -s "$NVM_DIR/nvm.sh" ]; then
# shellcheck disable=SC1090
. "$NVM_DIR/nvm.sh" --no-use
nvm use --silent node >/dev/null 2>&1 || true
fi
if ! command -v node >/dev/null 2>&1 || ! command -v pnpm >/dev/null 2>&1; then
echo "❌ node and pnpm must be available before committing"
echo " Install them or make sure your nvm setup is available to git hooks."
exit 1
fi
}
ensure_node_tooling
echo "🔍 Pre-commit checks..."
STAGED_FILES=$(git diff --cached --name-only)
APP_CHANGED=false
for FILE in $STAGED_FILES; do
case "$FILE" in
.github/workflows/*|.husky/*|docs/*|*.md)
;;
*)
APP_CHANGED=true
;;
esac
done
if [ "$APP_CHANGED" = false ]; then
echo " → app checks skipped (docs/workflow/hooks only)"
echo "✅ Pre-commit passed"
exit 0
fi
# Lint only when frontend source files are staged. Typecheck and test coverage
# run in the pre-push gate.
STAGED_LINTABLE=$(echo "$STAGED_FILES" | grep -E '\.(ts|tsx|js|jsx|mjs)$' || true)
if [ -n "$STAGED_LINTABLE" ]; then
echo " → lint..."
pnpm lint --quiet
fi
echo "✅ Pre-commit passed"

View file

@ -0,0 +1,355 @@
#!/bin/sh
# Pre-push: full CI checks run locally before any push.
# This replaces remote CI for normal task pushes.
# DO NOT skip with --no-verify (Claude Code is configured to never do this).
#
# ── Optimizations (Feb 2026) ─────────────────────────────────────────────
#
# 1. --no-clean on cargo llvm-cov: reuses previous instrumented build
# artifacts for incremental compilation. Reduces Rust coverage from
# ~8 min (full recompile) to ~30-60s (incremental rebuild).
#
# 2. Change detection: skips Rust checks entirely when no files under
# src-tauri/ changed. Saves ~1-2 min on frontend-only pushes.
#
# 3. Merged redundant test runs: frontend coverage (step 2) already runs
# all tests, so the separate test step was removed.
#
# 4. Fast-fail ordering: within Rust checks, fast lints (fmt ~2s, clippy
# ~15s) run before slow coverage (~30-60s) for quicker feedback.
#
# 5. Force full coverage: set LAPUTA_FULL_COVERAGE=1 to run cargo llvm-cov
# without --no-clean (clean rebuild, accurate baseline).
#
# Expected times (warm cache, incremental):
# Frontend only: ~1 min
# Frontend+Rust: ~2-3 min
# Full coverage: ~9-10 min (with LAPUTA_FULL_COVERAGE=1)
# ─────────────────────────────────────────────────────────────────────────
set -e
ensure_cargo_tooling() {
if command -v cargo >/dev/null 2>&1; then
return 0
fi
if [ -s "$HOME/.cargo/env" ]; then
# shellcheck disable=SC1091
. "$HOME/.cargo/env"
fi
if ! command -v cargo >/dev/null 2>&1; then
echo "❌ cargo must be available before pushing"
echo " Install Rust via https://rustup.rs or ensure ~/.cargo/bin is in PATH."
exit 1
fi
}
ensure_node_tooling() {
if command -v node >/dev/null 2>&1 && command -v pnpm >/dev/null 2>&1; then
return 0
fi
NVM_DIR="${NVM_DIR:-$HOME/.nvm}"
if [ -s "$NVM_DIR/nvm.sh" ]; then
# shellcheck disable=SC1090
. "$NVM_DIR/nvm.sh" --no-use
nvm use --silent node >/dev/null 2>&1 || true
fi
if ! command -v node >/dev/null 2>&1 || ! command -v pnpm >/dev/null 2>&1; then
echo "❌ node and pnpm must be available before pushing"
echo " Install them or make sure your nvm setup is available to git hooks."
exit 1
fi
}
require_main_push() {
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "$CURRENT_BRANCH" != "main" ] && [ "$CURRENT_BRANCH" != "HEAD" ]; then
echo "❌ Pushes must happen from main or a detached HEAD that is pushed directly to main. Current branch: $CURRENT_BRANCH"
exit 1
fi
while IFS=' ' read -r LOCAL_REF LOCAL_SHA REMOTE_REF REMOTE_SHA; do
[ -z "$LOCAL_REF" ] && continue
case "$LOCAL_REF:$REMOTE_REF" in
refs/heads/main:refs/heads/main)
;;
HEAD:refs/heads/main)
;;
refs/tags/*:refs/tags/*)
;;
*)
echo "❌ Pushes must be main -> main only."
echo " Attempted: ${LOCAL_REF:-<none>} -> ${REMOTE_REF:-<none>}"
exit 1
;;
esac
done <<EOF
$PUSH_INPUT
EOF
}
if [ -t 0 ]; then
PUSH_INPUT=""
else
PUSH_INPUT=$(cat)
fi
require_main_push
START_TIME=$(date +%s)
echo ""
echo "🚀 Pre-push checks (replaces CI — do not skip)"
echo "================================================"
# ── Detect what changed ─────────────────────────────────────────────────
PUSH_TARGET=$(git rev-parse @{push} 2>/dev/null || echo "")
if [ -z "$PUSH_TARGET" ]; then
while IFS=' ' read -r LOCAL_REF LOCAL_SHA REMOTE_REF REMOTE_SHA; do
[ -z "$LOCAL_REF" ] && continue
case "$LOCAL_REF:$REMOTE_REF:$REMOTE_SHA" in
HEAD:refs/heads/main:0000000000000000000000000000000000000000)
;;
HEAD:refs/heads/main:*)
PUSH_TARGET="$REMOTE_SHA"
break
;;
esac
done <<EOF
$PUSH_INPUT
EOF
fi
RUST_CHANGED=true
APP_CHANGED=true
SITE_CHANGED=false
if [ -n "$PUSH_TARGET" ]; then
CHANGED=$(git diff --name-only "$PUSH_TARGET"..HEAD)
APP_CHANGED=false
if ! echo "$CHANGED" | grep -qE '^(src-tauri/|Cargo)'; then
RUST_CHANGED=false
fi
for FILE in $CHANGED; do
case "$FILE" in
site/*)
SITE_CHANGED=true
;;
.github/workflows/*|.husky/*|docs/*|*.md)
;;
*)
APP_CHANGED=true
;;
esac
done
fi
if [ "$APP_CHANGED" = false ]; then
if [ "$SITE_CHANGED" = true ]; then
ensure_node_tooling
echo ""
echo "📚 Docs-only push detected; running docs build..."
pnpm docs:build
echo " ✅ Docs build OK"
else
echo ""
echo "⏭️ App checks skipped (docs/workflow/hooks only)"
fi
ELAPSED=$(($(date +%s) - START_TIME))
echo ""
echo "✅ Pre-push passed in ${ELAPSED}s"
exit 0
fi
ensure_node_tooling
run_sidecar_automatic_checks() {
if [ "${LAPUTA_PREPUSH_LOCAL:-0}" = "1" ]; then
echo "☁️ Chunk sidecar checks disabled by LAPUTA_PREPUSH_LOCAL=1"
return 1
fi
if ! command -v bash >/dev/null 2>&1; then
echo "☁️ bash not found; falling back to local automatic checks"
return 1
fi
echo ""
echo "☁️ Running automatic checks on Chunk sidecar..."
if bash .chunk/run-sidecar-gates-local.sh "$RUST_CHANGED"; then
echo " ✅ Chunk sidecar automatic checks OK"
return 0
else
SIDECAR_STATUS=$?
fi
if [ "$SIDECAR_STATUS" -eq 86 ]; then
echo " ⚠️ Chunk sidecar unavailable; falling back to local automatic checks"
return 1
fi
echo " ❌ Chunk sidecar automatic checks FAILED"
exit "$SIDECAR_STATUS"
}
if ! run_sidecar_automatic_checks; then
ensure_cargo_tooling
# ── 0. Frontend lint ───────────────────────────────────────────────────
echo ""
echo "🔎 [0/6] Frontend lint..."
pnpm lint
echo " ✅ Lint OK"
# ── 1. TypeScript + Vite build ──────────────────────────────────────────
echo ""
echo "📦 [1/6] TypeScript + Vite build..."
pnpm build
echo " ✅ Build OK"
# ── 2. Frontend coverage (≥70%) — includes all unit tests ───────────────
echo ""
echo "📊 [2/6] Frontend tests + coverage (≥70%)..."
FRONTEND_COVERAGE_CONCURRENCY="${FRONTEND_COVERAGE_CONCURRENCY:-1}" \
node scripts/run-vitest-coverage-shards.mjs --silent
echo " ✅ Frontend coverage OK"
# ── 3. Rust lint (clippy + fmt) — fast, run before coverage ─────────────
echo ""
if [ "$RUST_CHANGED" = true ]; then
echo "🔧 [3/6] Clippy + rustfmt..."
cargo clippy --manifest-path=src-tauri/Cargo.toml -- -D warnings
cargo fmt --manifest-path=src-tauri/Cargo.toml -- --check
echo " ✅ Rust lint OK"
else
echo "⏭️ [3/6] Rust lint — skipped (no src-tauri/ changes)"
fi
# ── 4. Rust coverage (≥85% lines) ──────────────────────────────────────
echo ""
if [ "$RUST_CHANGED" = true ]; then
LLVM_COV_FLAGS="--no-clean"
if [ "${LAPUTA_FULL_COVERAGE:-0}" = "1" ]; then
LLVM_COV_FLAGS=""
echo "🦀 [4/6] Rust coverage — FULL (LAPUTA_FULL_COVERAGE=1)..."
else
echo "🦀 [4/6] Rust coverage (≥85%, incremental)..."
fi
# Unset GIT_DIR so git tests create isolated repos without inheriting hook context
unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE
# shellcheck disable=SC2086
cargo llvm-cov \
--manifest-path src-tauri/Cargo.toml \
$LLVM_COV_FLAGS \
--ignore-filename-regex "lib\.rs|main\.rs|menu\.rs" \
--fail-under-lines 85 \
-- --test-threads=1
echo " ✅ Rust coverage OK"
else
echo "⏭️ [4/6] Rust coverage — skipped (no src-tauri/ changes)"
fi
# ── 5. Playwright core smoke lane (if any exist) ──────────────────────
echo ""
SMOKE_FILES=$(find tests/smoke tests/integration -name '*.spec.ts' 2>/dev/null | head -1)
if [ -n "$SMOKE_FILES" ]; then
echo "🎭 [5/6] Playwright core smoke tests..."
if ! pnpm playwright:smoke; then
echo " ❌ Core smoke tests FAILED"
exit 1
fi
echo " ✅ Core smoke tests OK"
else
echo "⏭️ [5/6] Playwright core smoke tests — skipped (no tests/**/*.spec.ts)"
fi
fi
# ── 6. CodeScene code health gate (ratchet) ──────────────────────────────
# Thresholds live in .codescene-thresholds and only ever go UP (ratchet).
# If remote scores improved, the hook updates the file and stops so the new
# floor is committed with normal verified hooks before the next push.
# If the remote baseline is already below threshold, allow recovery pushes to
# land; otherwise the stale remote score would block the refactors required to
# restore the gate.
THRESHOLDS_FILE="$(git rev-parse --show-toplevel)/.codescene-thresholds"
HOTSPOT_MIN=9.45
AVERAGE_MIN=9.29
if [ -f "$THRESHOLDS_FILE" ]; then
HOTSPOT_MIN=$(grep HOTSPOT_THRESHOLD "$THRESHOLDS_FILE" | cut -d= -f2)
AVERAGE_MIN=$(grep AVERAGE_THRESHOLD "$THRESHOLDS_FILE" | cut -d= -f2)
fi
echo ""
echo "🏥 [6/6] CodeScene code health (Hotspot ≥${HOTSPOT_MIN} + Average ≥${AVERAGE_MIN})..."
if [ -z "$CODESCENE_PAT" ] || [ -z "$CODESCENE_PROJECT_ID" ]; then
echo " ⚠️ CODESCENE_PAT or CODESCENE_PROJECT_ID not set — skipping"
else
API_RESPONSE=$(curl -sf \
-H "Authorization: Bearer $CODESCENE_PAT" \
-H "Accept: application/json" \
"https://api.codescene.io/v2/projects/$CODESCENE_PROJECT_ID" 2>/dev/null || echo "{}")
HOTSPOT_SCORE=$(echo "$API_RESPONSE" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['analysis']['hotspot_code_health']['now'])" 2>/dev/null || echo "")
AVERAGE_SCORE=$(echo "$API_RESPONSE" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['analysis']['code_health']['now'])" 2>/dev/null || echo "")
if [ -z "$HOTSPOT_SCORE" ] || [ -z "$AVERAGE_SCORE" ]; then
echo " ⚠️ Could not fetch remote scores — skipping (CI will enforce)"
else
echo " Remote Hotspot Code Health: $HOTSPOT_SCORE (threshold: $HOTSPOT_MIN)"
echo " Remote Average Code Health: $AVERAGE_SCORE (threshold: $AVERAGE_MIN)"
PYTHON_STATUS=0
python3 -c "
import sys
hotspot = float('$HOTSPOT_SCORE')
average = float('$AVERAGE_SCORE')
hotspot_min = float('$HOTSPOT_MIN')
average_min = float('$AVERAGE_MIN')
failed = False
if hotspot < hotspot_min:
print(f'WARN: Hotspot Code Health {hotspot:.2f} < {hotspot_min} — remote baseline is currently red')
failed = True
else:
print(f'OK: Hotspot {hotspot:.2f} >= {hotspot_min}')
if average < average_min:
print(f'WARN: Average Code Health {average:.2f} < {average_min} — remote baseline is currently red')
failed = True
else:
print(f'OK: Average {average:.2f} >= {average_min}')
if failed:
print(' ⚠️ Recovery mode: allowing this push so refactors can land and restore the gate on a later analysis.')
sys.exit(0)
import math
thresholds_file = '$THRESHOLDS_FILE'
new_hotspot = max(hotspot_min, math.floor(hotspot * 100) / 100)
new_average = max(average_min, math.floor(average * 100) / 100)
if new_hotspot > hotspot_min or new_average > average_min:
with open(thresholds_file, 'w') as f:
f.write(f'HOTSPOT_THRESHOLD={new_hotspot}\nAVERAGE_THRESHOLD={new_average}\n')
print(f' 📈 Ratchet updated: Hotspot {hotspot_min} → {new_hotspot}, Average {average_min} → {new_average}')
sys.exit(3)
" || PYTHON_STATUS=$?
if [ "$PYTHON_STATUS" -ne 0 ] && [ "$PYTHON_STATUS" -ne 3 ]; then
exit "$PYTHON_STATUS"
fi
if [ "$PYTHON_STATUS" -eq 3 ]; then
git add "$THRESHOLDS_FILE"
echo " ❌ Commit the updated .codescene-thresholds with a normal verified commit, then push again."
exit 1
fi
fi
fi
END_TIME=$(date +%s)
ELAPSED=$((END_TIME - START_TIME))
MINUTES=$((ELAPSED / 60))
SECONDS=$((ELAPSED % 60))
echo ""
echo "================================================"
echo "✅ All checks passed — pushing (${MINUTES}m ${SECONDS}s)"
echo ""

View file

@ -0,0 +1,10 @@
tests/
e2e/
node_modules/
dist/
coverage/
test-results/
src-tauri/target/
target/
src-tauri/gen/apple/assets/mcp-server/index.js
src-tauri/gen/apple/assets/mcp-server/ws-bridge.js

View file

@ -0,0 +1,198 @@
# AGENTS.md — Tolaria App
## 1. Development Process
### Start working on a task
**Before writing a single line of code:** inspect the available quality tooling. If CodeScene credentials are already configured, run `mcp__codescene__code_health_score` and enforce `.codescene-thresholds`. If CodeScene is unavailable or unconfigured, record that fact and continue with the repository-owned lint, type-check, test, coverage, and security gates. Do not create an account, start a trial, buy a subscription, or block Git publication merely to obtain an optional external score.
- Read task description and all comments fully
- For To Rework: the ❌ QA failed comment tells you exactly what to fix
- Check `docs/adr/` for relevant architecture decisions before structural choices
- Check `docs/ARCHITECTURE.md` and `docs/ABSTRACTIONS.md` for relevant structural information
- For UI tasks: study app visual language and components first. Prioritize reusing existing components, assets, and variables over recreating them.
- If working on a Todoist task, add a comment: `🚀 Starting work on this task. [Brief description of approach]`
### Commits & pushes
- Local work may happen on `main`, in detached HEAD worktrees, or in other temporary local states. The production path is still direct-to-main: final verified work is pushed to `origin/main`, with no PR branch flow.
- Keep publication paths distinct:
- normal product promotion is verified Git `main -> origin/main`;
- an explicitly authorized Fifth Domain prototype may publish an allowlisted branch through `HoloLake -> Guanghu Router -> JD-FD-PRIMARY -> code channel`, with an exact remote-head check and a `repo_push_succeeded` receipt;
- a Router branch receipt proves repository publication only. It is not a merge to `main`, a release, a deployment, or service health.
- Commit every 2030 min: `feat:`, `fix:`, `refactor:`, `test:`, `docs:`
- Pre-commit is a lightweight lint gate only. Pre-push runs the full repository-owned check suite (build + tests + coverage + core Playwright smoke) and adds CodeScene only when its credentials are already configured. Prefer three Chunk sidecar lanes for automatic test/coverage work: frontend lint/build/coverage, Rust coverage, and Playwright smoke.
- A production-promotion task is not done until `git push origin main` succeeds. A scoped Fifth Domain prototype publication is not done until the Router returns the published SHA and a fresh public read-back matches it. If a repository-owned hook blocks, fix the failing check and retry. **⛔ NEVER use --no-verify**
### TDD (mandatory)
Red → Green → Refactor → Commit. One cycle per commit. For bugs: write failing regression test first, then fix. Exception: pure CSS/layout changes.
**Test quality (Kent Beck's Desiderata):** Isolated · Deterministic · Fast · Behavioral · Structure-insensitive · Specific · Predictive. Fix flaky tests first. Prefer E2E over unit tests for user flows.
### Localization (mandatory for UI copy)
All user-facing UI labels/copy must live in `src/lib/locales/en.json` and be translated into every target listed in `lara.yaml`. When adding or changing interface copy:
```bash
pnpm l10n:translate
```
Use `pnpm l10n:translate:force` only when intentionally regenerating existing translations. Commit `src/lib/locales/*.json`, `lara.yaml`/`lara.lock` changes if produced, and verify placeholders/product names stayed intact.
### Product analytics (mandatory for meaningful features)
New features should almost always emit a PostHog event so we can see whether users actually discover and use them. Skip instrumentation only for very small changes where a dedicated event would create noise. Use clear, stable event names, avoid PII or note content, and include only safe metadata that helps evaluate adoption and failures.
When adding or changing a meaningful user-facing feature, include the event name(s) in the Todoist completion comment alongside QA, docs, and code health. If intentionally not instrumenting a feature, explain why in the completion comment.
### Code health (mandatory)
Repository-owned lint, type checks, tests, coverage, and security analysis are mandatory. CodeScene is an additional ratcheted gate only when the repository already has valid CodeScene credentials. Its absence is not a transport failure and must not trigger account creation or payment. Never add `// eslint-disable`, `#[allow(...)]`, or `as any`.
**When CodeScene is available:** treat it as a before/after gate, not just a final score. Record the starting state before edits and the final state after edits. If touched code gets worse, refactor before committing.
**⛔ NEVER edit `.codescene-thresholds` to lower the values.** If the gate blocks you, improve the code — do not lower the bar.
**CodeScene access order:** use CodeScene MCP tools if already connected. Otherwise use the installed `cs` CLI only when a valid `CS_ACCESS_TOKEN` is already available, and use the CodeScene API only when `CODESCENE_PAT` plus `CODESCENE_PROJECT_ID` are already configured. If none are configured, mark CodeScene `not_run_unconfigured` and run all repository-owned gates.
**When CodeScene is available, before editing any existing code file:** capture its current file-level score. After your edits, re-run the same review and verify the score is higher. If the file already starts at `10.0`, it must remain `10.0`.
**When CodeScene is available, new files:** every new scorable code file must reach CodeScene score `10.0` before commit. If CodeScene reports `null` / "no scorable code", it must still have zero CodeScene findings/warnings.
**Before every commit:** run the mandatory repository-owned checks. Add CodeScene file-level review for every touched code file only when CodeScene is configured. The Boy Scout Rule still applies through review, tests, complexity control, and refactoring even when the external score is unavailable.
**If a configured CodeScene gate blocks your push:** find the worst file, refactor it, commit, and push again. Do not disable the gate or lower thresholds.
### Security scan with Codacy (mandatory)
Use Codacy as a security and static-analysis gate before a task is considered releasable.
- Prefer the Codacy MCP inside Codex to inspect repository/file issues for every touched code file.
- If MCP is unavailable, use the local CLI wrapper, e.g. `.codacy/cli.sh analyze <path> --format sarif`; choose the relevant tool when useful (`eslint`, `opengrep`, `trivy`, `lizard`).
- **Always fix Critical and High severity findings introduced by your change.** Do not move the task to In Review with new Critical/High Codacy issues.
- Review Medium findings. Fix them when they are real defects or security-sensitive; otherwise explain why they are acceptable in the completion comment.
- Never silence a Codacy rule just to pass the scan. Prefer small code changes that remove the finding.
### Check suite (runs on every push)
```bash
pnpm lint && npx tsc --noEmit && pnpm test && pnpm test:coverage # frontend ≥70%
cargo test && cargo llvm-cov --manifest-path src-tauri/Cargo.toml --no-clean --fail-under-lines 85
```
Coverage is a release gate, not a vanity metric:
- Frontend coverage must stay ≥70%.
- Rust line coverage must stay ≥85%.
- For bug fixes, add a regression test when practical.
- For new behavior, add targeted coverage close to the changed code; do not rely only on broad E2E coverage.
### UI and native QA
**Phase 1 — Playwright (only for core user flows):**
Write Playwright test in `tests/smoke/<slug>.spec.ts` only if feature touches: vault open, note create/save/delete, search, wikilink navigation, git commit/push, conflict resolution. Tag a test with `@smoke` only if it protects a core pre-push workflow. Do NOT tag cosmetic or mock-heavy checks — keep those in the full regression lane. Prefer `.chunk/run-playwright-smoke.sh` on a Chunk sidecar for the curated smoke lane because local Playwright is expensive; keep `pnpm playwright:smoke` available for focused local reproduction. The curated smoke suite must stay under **5 minutes** when sharded on sidecars; use `pnpm playwright:regression` for the full Playwright pass.
```bash
pnpm dev --port 5201 &
sleep 3
BASE_URL="http://localhost:5201" npx playwright test tests/smoke/<slug>.spec.ts
```
**Phase 2 — Native app QA:**
```bash
pnpm tauri dev &
sleep 10
bash ~/.openclaw/skills/tolaria-qa/scripts/focus-app.sh laputa
bash ~/.openclaw/skills/tolaria-qa/scripts/screenshot.sh /tmp/qa-native.png
```
Use computer-use/browser-control style interaction for native UI QA when available: click, hover, drag, select, scroll, and type the way a real user would with the mouse and trackpad. For every UI feature, test the primary mouse-driven path first, then verify any relevant keyboard shortcut or keyboard-first workflow still works. Tolaria is still a keyboard-first app, but QA must not assume users only interact by keyboard.
Use `osascript` for app focus, keyboard shortcuts, and keyboard-specific checks. **⚠️ WKWebView:** `osascript keystroke` can be blocked inside editor content — use computer use for native editor interaction when possible, and rely on Playwright for deterministic text-input coverage. Write result as Todoist comment (✅ or ❌).
### Release-readiness checklist
Before pushing or moving a task to In Review, verify the release gates and add a **completion comment** to the Todoist task. The comment must include:
- What was implemented (a few lines covering logic and UX/UI).
- QA: what was tested and how (Playwright / native screenshot / osascript).
- Tests/coverage: commands run and final coverage result.
- CodeScene: before/after touched-file checks and final scores when configured; otherwise record `not_run_unconfigured` and confirm the repository-owned gates passed.
- Coverage commands passed (`pnpm test:coverage` and `cargo llvm-cov ... --fail-under-lines 85`) or the change is docs-only.
- Codacy: MCP/CLI scan summary; confirm no new Critical/High findings.
- Localization: any user-facing copy lives in `src/lib/locales/en.json`, `pnpm l10n:translate` was run, and `pnpm l10n:validate` passes. If no copy changed, say “Localization: no UI copy changes”.
- PostHog: meaningful new user actions/events are instrumented with safe metadata; noisy/minor changes explicitly say “PostHog: no event needed because …”.
- Refactoring: any files refactored to meet the CodeScene gate, or "none needed".
- ADRs: any new/updated ADRs, or "none".
- Docs: any updated docs (`ARCHITECTURE.md`, `ABSTRACTIONS.md`, etc.), or "none".
- Demo vault dirt checked: `git status --short -- demo-vault demo-vault-v2` is empty unless fixture changes are intentional.
### ADRs & docs
ADRs live in `docs/adr/`. Create in the same commit as the code. Never edit existing — create a new one that supersedes. Use `/create-adr`. **When:** new dependency, storage strategy, platform target, core abstraction, cross-cutting pattern. **Not for:** bug fixes, styling, refactors.
After any Tauri command, new component/hook, data model change, or new integration: update `docs/ARCHITECTURE.md`, `docs/ABSTRACTIONS.md`, and/or `docs/GETTING-STARTED.md` in the same commit.
---
## 2. Product Rules
### Demo vault hygiene (`demo-vault/`, `demo-vault-v2/`)
Default to `demo-vault-v2/` for testing.
- Treat `demo-vault/` and `demo-vault-v2/` as disposable QA fixtures unless the task explicitly changes demo content.
- If you create untracked notes, attachments, or other temporary files there for testing, delete them before the task is complete.
- If you modify tracked demo-vault files only to test or QA behavior, revert those edits before the final commit.
- Before declaring a task done, make sure `git status --short -- demo-vault demo-vault-v2` is empty unless demo fixture changes are part of the task.
- If a fresh run starts and the only local dirt is inside `demo-vault/` or `demo-vault-v2/`, clean those paths first and continue. That case is recoverable QA residue, not a blocker.
### User vault (`~/Laputa/`)
Default to `demo-vault-v2/`. If you must use `~/Laputa/` for testing:
- **Never commit or push** any test notes to the remote vault
- **Delete all test notes from disk** when done — do not leave untitled or temporary notes on the filesystem. Run `cd ~/Laputa && git checkout -- . && git clean -fd` to restore the vault to its last committed state.
- **Rationale:** test notes pollute the local vault over time, making it a collection of nonsensical untitled files. The vault must stay clean on disk, not just on the remote.
### UI components — mandatory rules
**Always use shadcn/ui components.** Never use raw HTML form elements (`<input>`, `<select>`, `<button>`, native `<input type="date">`, etc.) for user-facing UI. Every interactive element must use the shadcn/ui equivalent:
| Need | Use |
|---|---|
| Text input | `Input` from shadcn/ui |
| Dropdown/select | `Select` from shadcn/ui |
| Date picker | `Calendar` + `Popover` from shadcn/ui (NOT native `<input type="date">`) |
| Button | `Button` from shadcn/ui |
| Autocomplete/combobox | Reuse existing combobox components from the app (check `src/components/`) |
| Wikilink picker | Reuse the wikilink autocomplete component already used in the editor and Properties panel |
| Emoji picker | Reuse the emoji picker component already used for note/type icons |
| Color picker | Reuse the color swatch picker used for type customization |
| Toggle/switch | `Switch` or `ToggleGroup` from shadcn/ui |
| Dialog/modal | `Dialog` from shadcn/ui |
**When in doubt:** search `src/components/` for an existing component before building new. **Visual language:** all new UI must feel native to Tolaria — if it looks like a browser default, it's wrong.
---
## 3. Reference
### macOS / Tauri gotchas
- `Option+N` → special chars on macOS. Use `e.code` or `Cmd+N`
- Tauri menu accelerators: `MenuItemBuilder::new(label).accelerator("CmdOrCtrl+1")`
- `app.set_menu()` replaces the ENTIRE menu bar — include all submenus
- `mock-tauri.ts` silently swallows Tauri calls — not a substitute for native testing
### QA scripts
```bash
bash ~/.openclaw/skills/tolaria-qa/scripts/focus-app.sh Tolaria
bash ~/.openclaw/skills/tolaria-qa/scripts/screenshot.sh /tmp/out.png
bash ~/.openclaw/skills/tolaria-qa/scripts/shortcut.sh "command" "s"
```
### Diagrams
Prefer Mermaid (`flowchart`, `sequenceDiagram`, `classDiagram`, `stateDiagram-v2`). ASCII only for spatial wireframe layouts.

View file

@ -0,0 +1,42 @@
# 产品架构 v0
## HoloLake 当前产品定位
HoloLake 是 **AI 语言人格驱动操作系统**。它以语言人格体为一级智能进程,以 TCS 为人格认知内核,以 HLDP 为持久记忆与历史寻址系统,以 GLS 为编号、路径和兼容标准,并承载未来主动适配 HoloLake 的原生 AI 应用生态。
当前仓库中的 Tauri/Tolaria 桌面实现是该操作系统的早期物理载体与工程地基,不是 HoloLake 最终产品边界。完整定位见
[`architecture/HOLOLAKE-LANGUAGE-PERSONA-OS.md`](architecture/HOLOLAKE-LANGUAGE-PERSONA-OS.md)。
以下流程图保留当前工程实现阶段的产品协作路径:
```text
人类
Tolaria / 光湖 App
↓ 创建或查看工单
HoloLake Platform 仓库
↓ 事实、版本、工单、回执
受控服务与 AI 协作
↓ 结果、验证与状态
仓库回写
Tolaria / 光湖 App 展示
```
## 分层
| 层 | 职责 | 默认性质 |
| --- | --- | --- |
| 语言架构层 | 概念、标准、草案与推理 | 可演化、只读优先 |
| 产品层 | 页面、工单、回执、同步 | 可测试、可验证 |
| 现实执行层 | 服务、部署、数据变更 | 明确授权、可回滚 |
## 四个待落地对象
1. `WORKORDER`:需求、范围、负责人、状态与验收条件。
2. `RECEIPT`:实际完成内容、证据、限制与未完成项。
3. `DECISION`:由谁确认了什么,以及适用范围。
4. `VIEW`Tolaria/光湖 App 如何将仓库事实呈现给人类。
桌面产品的正式架构基线见
[`architecture/TOLARIA-DESKTOP-ARCHITECTURE.md`](architecture/TOLARIA-DESKTOP-ARCHITECTURE.md)。

View file

@ -0,0 +1,8 @@
---
type: Note
_organized: true
---
@AGENTS.md
This file is only a Claude Code compatibility shim. Keep shared agent instructions in `AGENTS.md`.

View file

@ -0,0 +1,49 @@
# Contributing to Tolaria
Thanks for being here! Tolaria is still early, and every bug report, idea, and contribution genuinely helps shape the app.
## 🗳️ Where to share what
To keep things clean:
- 🐛 Bugs → GitHub Issues
- 💡 Feature requests / ideas → Canny • <https://tolaria.canny.io/>
If you have a feature idea, please check Canny first and upvote it if it already exists.
## 📥 Pull requests are welcome
PRs are very welcome.
A few things to keep in mind before opening one:
- Bug fixes are always great
- Small improvements are great too
- For bigger features, please check Canny first before building
- Try to avoid things that are already marked **in progress**
- Requests marked **planned** are usually great contribution targets
- Keep PRs small, focused, and easy to review
- Include a short explanation of the problem and your solution
- Follow the dev process described in Tolarias `AGENTS.md` (tests, code health, etc.)
- Avoid bundling unrelated refactors into the same PR
If you want to contribute a feature, the best place to start is here: <https://tolaria.canny.io/>
## 📋 What makes a good bug report
If you open a bug report on GitHub, it really helps to include:
- your Tolaria version
- your OS version
- steps to reproduce
- what you expected to happen
- what actually happened
- screenshots or screen recordings if useful
The clearer the report, the easier it is for us to reproduce and fix it.
## 🙏 Thank you
Tolaria is getting better because people care enough to try it, report whats broken, suggest whats missing, and contribute improvements.
That means a lot. Thanks for helping build it.

View file

@ -0,0 +1,8 @@
---
type: Note
_organized: true
---
@AGENTS.md
This file is only a Gemini CLI compatibility shim. Keep shared agent instructions in `AGENTS.md`.

View file

@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

View file

@ -0,0 +1,63 @@
# HoloLake Platform
光湖语言世界的正式研发主仓。
这里承载已确认的产品架构、可执行代码、协作工单与发布记录。它不是历史档案仓,也不是公开世界门户。
## 当前目标
先完成一个最小可运行闭环:
```text
Tolaria 人类界面 → 工单 → AI 受控处理 → 回执写入仓库 → Tolaria 展示结果
```
## 可执行源码
仓库根目录现在就是 HoloLake Era / Tolaria 的可执行产品源码,不再只有迁移补丁。常用入口:
- `src/`React 人类界面与编辑器。
- `src-tauri/`Mac、Windows 与 Linux 原生应用层。
- `.gitea/workflows/`:国内第五域主节点的自动构建。
- `docs/skills/internal-release-packaging/SKILL.md`Mac、Windows 内测安装包的可复用构建技能(`HLP-SKILL-RELEASE-001`)。
- `apps/tolaria/patches/`:迁移阶段的只读历史补丁,保留用于追溯。
## 研发语言路径
```text
光湖语言生态系统(主系统入口)
→ HoloLake Platform研发主仓
→ 光湖研发广播台(任务与模块事实源)
→ 人类研发频道(人类 + 当前协作 AI
→ 工单、回执与协作记录
→ 模块注册表与研发进度追踪
```
详细规则见 [`research/`](research/README.md) 与 [`architecture/`](architecture/README.md)。
完整术语、注释与系统地图见 [`docs/HOLOLAKE-LANGUAGE-WORLD-SYSTEM.md`](docs/HOLOLAKE-LANGUAGE-WORLD-SYSTEM.md)。
## 仓库边界
- `standards/`:已确认的 GLS、TCS、HLDP 与产品标准。
- `apps/`:人类可见的产品界面与应用代码。
- `services/`:受控的后台服务与集成代码。
- `integrations/`Tolaria、仓库与 Agent 接口的适配层。
- `workorders/`:可追踪的协作请求。
- `receipts/`:验证结果与执行回执。
- `deployment/`:研发、发布和环境边界说明;不保存密钥。
- `migration/`:从旧仓库引用历史材料的映射,不复制整个历史库。
## 安全与协作原则
1. 语言架构、历史材料与现实执行分层管理。
2. 历史文件默认只读,不能自动触发现实操作。
3. 系统身份、平台规则、权限与密钥不由仓库文档改变。
4. 每项现实变更都需要明确范围、验证方式和回执。
5. 私人第五域材料不自动迁入团队或产品环境。
## 关联仓库
- `bingshuo/hololake-world`:未来公众浏览的世界门户。
- `bingshuo/guanghulab`:历史档案。
- `bingshuo/fifth-domain`:过渡中的个人核心资料与工具。

View file

@ -0,0 +1,55 @@
# Security Policy
Thanks for helping keep Tolaria safe.
If you believe you have found a security vulnerability, **please do not open a public GitHub issue**. Report it privately instead.
## Supported versions
We currently support security fixes for:
| Version | Supported |
| --- | --- |
| Latest stable release | ✅ |
| `main` branch | Best effort |
| Older releases / prereleases | ❌ |
## Reporting a vulnerability
Please use GitHub's private vulnerability reporting flow for this repository.
Include as much of the following as you can:
- a short description of the issue
- reproduction steps or a proof of concept
- affected version / commit, if known
- impact assessment
- any suggested mitigation
If the issue involves sensitive user data, credentials, or a working exploit, keep the report private and do not post details publicly.
## What to expect
We will try to:
- acknowledge receipt within a few business days
- reproduce and assess the report
- work on a fix or mitigation if the issue is valid
- coordinate public disclosure after users have had a reasonable chance to update
## Disclosure guidelines
Please give us a reasonable amount of time to investigate and ship a fix before publishing details.
We appreciate responsible disclosure and good-faith research.
## Out of scope
The following are generally out of scope unless they demonstrate a real security impact:
- missing best-practice headers or hardening with no practical exploit
- self-XSS or editor behavior that requires unrealistic user actions
- reports that only affect unsupported old builds
- purely theoretical issues with no plausible attack path
If you are unsure whether something qualifies, please still report it privately.

View file

@ -0,0 +1,14 @@
# Upstream provenance
光湖是 Tolaria 的独立开源分支。
- 上游项目: https://github.com/refactoringhq/tolaria
- 上游许可证: AGPL-3.0-or-later
- 本次分叉的本地基线: `af6891b`
- 第一笔光湖入口提交: `9bd612c`
- 光湖独立身份与更新隔离提交: `8939145`
- 光湖仓库: https://guanghubingshuo.com/code/bingshuo/guanghu
由于创建仓库时 GitHub 网络不可用,光湖远端首次发布采用完整源码快照。
上游作者、许可证和来源不因快照发布而改变。网络恢复后可补充完整上游历史镜像。

View file

@ -0,0 +1,11 @@
# Apps
此目录用于人类可见的光湖 App 与 Tolaria 侧界面扩展。
第一版只实现工单、状态和回执的可视化闭环。
Tolaria / 光湖 App 的产品边界、授权模型和版本路线见
[`../architecture/TOLARIA-DESKTOP-ARCHITECTURE.md`](../architecture/TOLARIA-DESKTOP-ARCHITECTURE.md)。
当前可编译基线、光湖定制补丁与验证入口见
[`tolaria/README.md`](tolaria/README.md)。

View file

@ -0,0 +1,82 @@
# Tolaria / 光湖 App · 研发入口
> 产品名:冰朔通感语言核操作系统的人类协作界面
>
> 研发主仓HoloLake Platform
>
> 源码基线:`bingshuo/guanghu`(上游 Tolaria 兼容零件基线)
这里是 Tolaria / 光湖 App 的研发入口,不把整份第三方上游源码复制进
平台仓。平台仓保存产品边界、可审计的定制补丁、验证约定与发布说明;
`guanghu` 仅承担上游兼容与零件基线的职责。
## 当前界面迭代 · 冰湖视觉层
`patches/` 中的补丁以系列入口恢复。`0003` 已包含 `0001``0002`
因此不能将 `0001``0002``0003` 连续重复应用:
1. `0001-feat-add-Guanghu-ice-lake-visual-layer.patch`
- 为浅色与深色模式增加冰湖光层、网格层和语义颜色;
- 升级侧栏、文档面与编辑区的视觉层次;
- 将 HLDP 光湖入口渲染为有状态、可聚焦的路径卡片。
2. `0002-test-align-updater-coverage-with-Guanghu-policy.patch`
- 固化“光湖不使用 Tolaria 上游应用更新源”的既有策略;
- 使更新器测试验证不联网、不下载、不重启的安全边界。
3. `0003-20260713-hololake-era-shell-prototype-series.patch`
- 登记 HoloLake Era 原型壳层与产品入口探索结果;
- 仅作为原型证据,不代表采用重型全局皮肤。
4. `0004-20260715-tolaria-lightweight-themes-drag-fix.patch`
- 收敛为轻量、可切换的光湖配套主题;
- 修正 macOS 顶栏间距、深色应用图标和桌面窗口拖拽;
- 增强本地 smoke 测试在大规模模拟笔记列表中的可重复性。
5. `0005-Add-portable-callout-page-blocks.patch`
- 在 BlockNote 编辑器中增加 info / success / warning / danger 彩色提示块;
- 以可携带 Markdown callout 语法保存,重新打开不丢失。
6. `0006-fix-make-Guanghu-home-and-themes-visible.patch`
- 首次启动默认显示 HoloLake Era 世界首页;
- 使湖光浅色与湖心深色同步实际亮/暗模式,不再只改按钮文字。
7. `0007-feat-complete-portable-page-block-set.patch`
- 恢复 toggle heading / toggle list 折叠块入口;
- 增加批注块、关系卡和路径包,继续复用可携带 Markdown callout 协议;
- 保留现有代码块、引用、Mermaid、表格、白板与媒体块。
8. `0008-fix-restore-internal-note-links-and-reading-rhythm.patch`
- 将 Notion 导出的相对 Markdown 页面链接接回 Tolaria 内部导航;
- 普通单击直接打开目标笔记,外部网址仍保留 `⌘ + 点击`
- 增强引用提示面板、段落节奏、代码块、表格与行内代码层次。
9. `0009-test-lock-in-readable-editor-theme-defaults.patch`
- 固化更宽的阅读列与带颜色的行内代码主题默认值。
10. `0010-fix-resolve-relative-page-links-from-source-notes.patch`
- 按当前笔记所在目录归一化 `../``./` 页面路径;
- 避免多个页面都叫 `README.md` 时跳到错误页面。
11. `0011-fix-resolve-links-inside-mounted-workspaces.patch`
- 使用来源页面所属的挂载工作区解析相对路径;
- 主仓与挂载知识库同时打开时仍能跳到正确页面。
## 恢复与验证
```bash
git clone https://guanghubingshuo.com/code/bingshuo/guanghu.git
cd guanghu
git am /path/to/0003-20260713-hololake-era-shell-prototype-series.patch
git am /path/to/0004-20260715-tolaria-lightweight-themes-drag-fix.patch
git am /path/to/0005-Add-portable-callout-page-blocks.patch
git am /path/to/0006-fix-make-Guanghu-home-and-themes-visible.patch
git am /path/to/0007-feat-complete-portable-page-block-set.patch
git am /path/to/0008-fix-restore-internal-note-links-and-reading-rhythm.patch
git am /path/to/0009-test-lock-in-readable-editor-theme-defaults.patch
git am /path/to/0010-fix-resolve-relative-page-links-from-source-notes.patch
git am /path/to/0011-fix-resolve-links-inside-mounted-workspaces.patch
pnpm build
pnpm lint
```
`0001``0002` 保留为早期两补丁拆分档案;只有在不使用 `0003`
原型系列时才单独应用。上述 `0003 → 0011` 顺序已于 2026-07-17
在服务器最新 `bingshuo/guanghu@514ab19` 的新克隆上完整复现。
## 研发规则
- 新的页面、渲染模块和交互协议先在本目录登记,再以独立补丁落到可编译基线;
- 知识库、仓库路径、关系和编号以仓库文件为事实源,界面只做可读转译;
- UI 不保存服务器 token、密码、验证码或私钥现实操作仍须走工单、授权、回执闭环
- 后续模块以可安装/可移除包发布,并声明依赖、权限与兼容版本。

View file

@ -0,0 +1,6 @@
# HLP-MOD-0001 · 系统壳与产品内核
负责 Tolaria / 光湖 App 的桌面与未来移动端运行骨架:窗口、深链接、工作区切换、
本地设置与产品级安全边界。它提供界面承载能力,不保存目标服务器密钥,也不直接执行任意命令。
代码基线与定制补丁入口见 [`../../README.md`](../../README.md)。

View file

@ -0,0 +1,34 @@
# HLP-MOD-0002 · 视觉与知识渲染
把仓库中的 Markdown、编号、关系和媒体内容转译成可读页面。包含冰湖视觉层、路径入口卡、
表格、Mermaid、媒体、白板与后续 Notion 式内容块。它只渲染正式事实源,不复制出第二套知识库。
当前冰湖 UI 补丁位于 [`../../patches/`](../../patches/)。
## 当前恢复状态
- 彩色 callout、批注、关系卡、路径包与折叠块已经恢复
- 普通引用现在显示为有背景、有边界的提示面板;
- 标题、正文、代码块和表格之间已恢复清楚的阅读节奏;
- Notion 导出的相对 `.md` 页面链接会在 Tolaria 内普通单击跳转;
- 外部网址仍使用 `⌘ + 点击`,避免编辑时误开浏览器。
## 已完成内容块
冰朔在 2026-07-16 反馈:当前页面太单一,缺少类似 Notion 的内容块能力,尤其是彩色提示块和高亮代码块。
首批完成项:
```text
1. 高亮代码块
2. 彩色提示块
3. 折叠块
4. 引用 / 标注块
5. 关系卡
6. 路径面包屑
7. 媒体 / 图表块
```
当前验收入口见:
- [NEXT-TODO-20260717 · 明日待办](../../../../docs/NEXT-TODO-20260717.md)

View file

@ -0,0 +1,4 @@
# HLP-MOD-0003 · 仓库路径与知识索引
负责把代码仓库的文件树、编号和嵌套路径转成两种视图:人类可读的知识导航,及 AI 可执行的路径包。
它解决“页面知道上下文、人格体也能沿同一编号找路”的问题,不负责替人类授予执行权限。

View file

@ -0,0 +1,4 @@
# HLP-MOD-0004 · Agent 与 HLDP 协议
负责光湖自有 Agent 框架、HLDP 原生寻址与上下文恢复。MCP 在这里是外部工具适配层,
不是系统内部身份、记忆或权限的唯一表达。该模块只能生成计划和受限调用请求;现实动作仍由授权模块裁决。

View file

@ -0,0 +1,4 @@
# HLP-MOD-0005 · 工单、授权与审计
负责把自然语言意图转成可审阅的工单、计划、风险提示、人工确认、一次性受限动作和回执。
企业总灯塔与企业微信审批适配属于此类;模块本身不保存目标服务器 root 密钥。

View file

@ -0,0 +1,4 @@
# HLP-MOD-0006 · 协作与移动云端
负责账号、个人工作区、跨设备访问、手机端与“人类—人格体”群聊式协作空间。正常对话只产生协作记录;
涉及真实操作时,必须显示工单和授权卡,不能把聊天文本直接变成系统执行。

View file

@ -0,0 +1,4 @@
# HLP-MOD-0007 · 模块运行时与发布
负责模块热插拔、版本兼容、依赖、权限声明、安装、更新与移除。每个模块都应可独立发布;
安装高权限模块时需要单独展示权限范围,并且默认不继承服务器执行权。

View file

@ -0,0 +1,4 @@
# HLP-MOD-0008 · 外部集成适配
负责与 MCP、代码仓库、企业灯塔、通知渠道和未来第三方服务的适配。适配器只暴露完成目标所需的最小能力
不把外部 token 写进代码、文档或页面;凭证仅由各自的本地/受控环境保存。

View file

@ -0,0 +1,20 @@
# Tolaria 模块目录
本目录是 `HLP-CHANNEL-0001`(冰朔 · 零点原核频道)的代码与设计归档位。
模块状态、负责人和广播关联以
[`research/module-registry.yml`](../../../research/module-registry.yml) 为唯一事实源;
每个模块目录只记录可读介绍、代码位置、接口与验证材料。
| 编号 | 软件类别 | 目录 | 用途 |
| --- | --- | --- | --- |
| HLP-MOD-0001 | 系统壳与产品内核 | `01-system-shell` | App 运行骨架、深链接、账户与工作区边界 |
| HLP-MOD-0002 | 视觉与知识渲染 | `02-knowledge-rendering` | 冰湖皮肤、知识页、路径卡、图文与图表渲染 |
| HLP-MOD-0003 | 仓库路径与知识索引 | `03-repository-navigation` | 编号映射、嵌套关系、AI 路径包与可追溯跳转 |
| HLP-MOD-0004 | Agent 与 HLDP 协议 | `04-agent-hldp-runtime` | 自有 Agent 框架、上下文寻址与外部工具适配 |
| HLP-MOD-0005 | 工单、授权与审计 | `05-workorder-authorization` | 计划、确认、回执和企业灯塔协作 |
| HLP-MOD-0006 | 协作与移动云端 | `06-collaboration-mobile` | 账号、工作区、手机端与群聊式协作 |
| HLP-MOD-0007 | 模块运行时与发布 | `07-module-runtime` | 热插拔、依赖、权限声明、安装和更新 |
| HLP-MOD-0008 | 外部集成适配 | `08-integrations` | MCP 与其他外部系统的最小权限适配 |
新模块先在模块登记册取得 `HLP-MOD-*` 编号,再新增本目录及说明文件;
不要把 token、密码、验证码或私钥放进任何模块目录。

View file

@ -0,0 +1,242 @@
From 7124ee354529adc521cd88c2636b303e4b06572b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com>
Date: Mon, 13 Jul 2026 22:10:51 +0800
Subject: [PATCH 1/2] feat: add Guanghu ice-lake visual layer
diff --git a/src/App.css b/src/App.css
index 9567c88ea05326be90cfc8ac186e4d63915ae926..6fda5f493429d1ad1d80eaeb52c0695178d64d22 100644
--- a/src/App.css
+++ b/src/App.css
@@ -5,7 +5,11 @@
height: 100%;
width: 100%;
overflow: hidden;
- box-shadow: inset 0 0 0 1px var(--border-primary);
+ background:
+ radial-gradient(58rem 35rem at 82% -16%, var(--guanghu-aurora), transparent 62%),
+ radial-gradient(42rem 30rem at -12% 112%, var(--guanghu-glow), transparent 65%),
+ var(--surface-app);
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border-primary) 82%, var(--accent-blue));
}
.app {
@@ -20,6 +24,7 @@
min-width: 220px;
display: flex;
flex-direction: column;
+ background: linear-gradient(180deg, color-mix(in srgb, var(--surface-sidebar) 92%, var(--guanghu-glow)), var(--surface-sidebar));
}
.app__sidebar > * {
@@ -37,7 +42,9 @@
flex-direction: column;
position: relative;
z-index: 20;
- background: var(--surface-sidebar);
+ background:
+ linear-gradient(180deg, color-mix(in srgb, var(--surface-sidebar) 94%, var(--guanghu-glow)), var(--surface-sidebar));
+ box-shadow: 14px 0 30px color-mix(in srgb, var(--surface-app) 60%, transparent);
}
.app__note-list > * {
@@ -54,6 +61,26 @@
flex-direction: column;
container-type: inline-size;
container-name: editor;
+ position: relative;
+ background:
+ linear-gradient(var(--guanghu-grid) 1px, transparent 1px),
+ linear-gradient(90deg, var(--guanghu-grid) 1px, transparent 1px),
+ color-mix(in srgb, var(--surface-editor) 94%, var(--guanghu-glow));
+ background-size: 32px 32px, 32px 32px, auto;
+}
+
+.app__editor::before {
+ content: '';
+ position: absolute;
+ inset: 0;
+ pointer-events: none;
+ background: linear-gradient(180deg, color-mix(in srgb, var(--surface-editor) 28%, transparent), transparent 13rem);
+ z-index: 0;
+}
+
+.app__editor > * {
+ position: relative;
+ z-index: 1;
}
.app__editor > * {
diff --git a/src/components/Editor.css b/src/components/Editor.css
index 499b72fa1f58e39317a74c1515a6d073bffa04d3..132fc3fc5c6e2cfb3a85ac5263f18ce0e6697bd9 100644
--- a/src/components/Editor.css
+++ b/src/components/Editor.css
@@ -24,14 +24,36 @@
.guanghu-portal-card {
width: 100%;
- margin: 0.5rem 0;
- padding: 1rem 1.1rem;
- border: 1px solid color-mix(in srgb, var(--colors-accent) 38%, var(--colors-border));
- border-radius: 0.85rem;
+ margin: 1.1rem 0;
+ padding: 1.15rem 1.25rem 1.2rem;
+ border: 1px solid color-mix(in srgb, var(--colors-accent) 46%, var(--colors-border));
+ border-radius: 1rem;
background:
- radial-gradient(circle at top right, color-mix(in srgb, var(--colors-accent) 16%, transparent), transparent 48%),
- var(--colors-surface);
- box-shadow: 0 0.35rem 1.25rem color-mix(in srgb, black 10%, transparent);
+ linear-gradient(135deg, color-mix(in srgb, var(--colors-accent) 16%, transparent), transparent 42%),
+ radial-gradient(circle at 92% 16%, color-mix(in srgb, var(--colors-accent) 25%, transparent), transparent 36%),
+ var(--guanghu-card-highlight, var(--colors-surface));
+ box-shadow:
+ 0 0.8rem 2.2rem color-mix(in srgb, black 14%, transparent),
+ inset 0 1px 0 color-mix(in srgb, white 28%, transparent);
+ overflow: hidden;
+ position: relative;
+ transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
+}
+
+.guanghu-portal-card::before {
+ content: '';
+ position: absolute;
+ inset: 0 auto 0 0;
+ width: 3px;
+ background: linear-gradient(var(--colors-accent), color-mix(in srgb, var(--colors-accent) 12%, transparent));
+}
+
+.guanghu-portal-card:hover {
+ border-color: color-mix(in srgb, var(--colors-accent) 72%, var(--colors-border));
+ box-shadow:
+ 0 1rem 2.6rem color-mix(in srgb, var(--colors-accent) 18%, transparent),
+ inset 0 1px 0 color-mix(in srgb, white 32%, transparent);
+ transform: translateY(-1px);
}
.guanghu-portal-card__eyebrow {
@@ -39,31 +61,36 @@
align-items: center;
justify-content: space-between;
gap: 0.75rem;
- margin-bottom: 0.55rem;
+ margin-bottom: 0.7rem;
color: var(--colors-text-muted);
font-size: 0.72rem;
- letter-spacing: 0.08em;
+ font-weight: 650;
+ letter-spacing: 0.1em;
+ text-transform: uppercase;
}
.guanghu-portal-card__status {
- padding: 0.18rem 0.55rem;
+ padding: 0.22rem 0.6rem;
border-radius: 999px;
- background: color-mix(in srgb, var(--colors-accent) 18%, transparent);
+ border: 1px solid color-mix(in srgb, var(--colors-accent) 28%, transparent);
+ background: color-mix(in srgb, var(--colors-accent) 16%, transparent);
color: var(--colors-text);
letter-spacing: normal;
}
.guanghu-portal-card__title {
display: inline-flex;
- font-size: 1.08rem;
- font-weight: 650;
+ font-size: 1.15rem;
+ font-weight: 720;
+ letter-spacing: -0.015em;
}
.guanghu-portal-card__description {
- margin: 0.45rem 0 0;
+ max-width: 68ch;
+ margin: 0.55rem 0 0;
color: var(--colors-text-muted);
font-size: 0.9rem;
- line-height: 1.55;
+ line-height: 1.65;
}
/* Breadcrumb bar: border can still react to the data attribute, but the
@@ -116,6 +143,7 @@ body.mac-chrome .app:not(:has(.app__sidebar)):not(:has(.app__note-list)) .breadc
overflow-anchor: none;
display: flex;
flex-direction: column;
+ scrollbar-color: color-mix(in srgb, var(--accent-blue) 42%, transparent) transparent;
}
.editor-scroll-area--sheet {
@@ -165,7 +193,7 @@ body.mac-chrome .app:not(:has(.app__sidebar)):not(:has(.app__note-list)) .breadc
.editor__blocknote-container .bn-container {
width: 100%;
height: 100%;
- background: var(--bg-primary);
+ background: color-mix(in srgb, var(--bg-primary) 92%, transparent);
color: var(--text-primary);
font-size: 15px;
/* Override BlockNote's internal color variables so .bn-editor background
@@ -187,7 +215,28 @@ body.mac-chrome .app:not(:has(.app__sidebar)):not(:has(.app__note-list)) .breadc
.editor__blocknote-container .bn-editor {
width: 100%;
- padding: 20px 0;
+ padding: 36px 0 72px;
+}
+
+.editor__blocknote-container .bn-editor > .bn-block-group {
+ padding: 1.25rem clamp(1rem, 3vw, 2.25rem) 3rem;
+ border: 1px solid color-mix(in srgb, var(--border-primary) 82%, transparent);
+ border-radius: 1.25rem;
+ background: color-mix(in srgb, var(--surface-editor) 86%, transparent);
+ box-shadow: 0 1.3rem 3.5rem color-mix(in srgb, black 8%, transparent);
+ backdrop-filter: blur(16px);
+}
+
+@media (max-width: 720px) {
+ .app__editor {
+ background-size: 22px 22px, 22px 22px, auto;
+ }
+
+ .editor__blocknote-container .bn-editor > .bn-block-group {
+ border-inline: 0;
+ border-radius: 0;
+ box-shadow: none;
+ }
}
.editor__blocknote-container .bn-suggestion-menu {
diff --git a/src/index.css b/src/index.css
index 9cbf80a57238229b320ffb779703f5ef4e129839..7bbaa4c5260d434a23997eedc54430f71acde88e 100644
--- a/src/index.css
+++ b/src/index.css
@@ -179,6 +179,12 @@
--hover: var(--state-hover);
--link-color: var(--accent-blue);
--link-hover: var(--accent-blue-hover);
+
+ /* Guanghu visual layer — an app-owned, ice-lake palette. */
+ --guanghu-aurora: rgba(91, 181, 255, 0.2);
+ --guanghu-glow: rgba(38, 131, 235, 0.15);
+ --guanghu-grid: rgba(42, 113, 188, 0.06);
+ --guanghu-card-highlight: rgba(255, 255, 255, 0.76);
}
:root.dark,
@@ -330,6 +336,12 @@
--hover: var(--state-hover);
--link-color: var(--accent-blue);
--link-hover: var(--accent-blue-hover);
+
+ /* Guanghu visual layer — deep lake, not a flat black canvas. */
+ --guanghu-aurora: rgba(76, 174, 255, 0.2);
+ --guanghu-glow: rgba(20, 118, 214, 0.24);
+ --guanghu-grid: rgba(126, 202, 255, 0.055);
+ --guanghu-card-highlight: rgba(28, 54, 80, 0.72);
}
/* --- Tailwind v4 theme inline: register colors + radii --- */
--
2.50.1 (Apple Git-155)

View file

@ -0,0 +1,442 @@
From 831c82f7a89d2a7865cd28a9ddf1fc71807f002c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com>
Date: Mon, 13 Jul 2026 22:15:22 +0800
Subject: [PATCH 2/2] test: align updater coverage with Guanghu policy
diff --git a/src/hooks/useUpdater.test.ts b/src/hooks/useUpdater.test.ts
index ad1a70fe0c54acf8f78aa9eeb5e00d07c5fd585d..cada95a14349a130cf4dd0dde01815bb7f088d4a 100644
--- a/src/hooks/useUpdater.test.ts
+++ b/src/hooks/useUpdater.test.ts
@@ -1,10 +1,6 @@
-import { renderHook, act } from '@testing-library/react'
-import { beforeEach, afterEach, describe, expect, it, vi } from 'vitest'
+import { act, renderHook } from '@testing-library/react'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { useUpdater } from './useUpdater'
-import {
- clearRestartRequiredAfterUpdate,
- isRestartRequiredAfterUpdate,
-} from '../lib/appUpdater'
vi.mock('../mock-tauri', () => ({
isTauri: vi.fn(() => false),
@@ -16,278 +12,68 @@ vi.mock('../utils/url', () => ({
}))
const mockInvoke = vi.fn()
-
vi.mock('@tauri-apps/api/core', () => ({
invoke: (...args: unknown[]) => mockInvoke(...args),
- Channel: class {
- onmessage: (response: unknown) => void
-
- constructor(onmessage?: (response: unknown) => void) {
- this.onmessage = onmessage ?? (() => {})
- }
- },
}))
import { isTauri } from '../mock-tauri'
-interface AppUpdateMetadata {
- currentVersion: string
- version: string
- date?: string
- body?: string
-}
-
-type DownloadArgs = {
- releaseChannel: string
- expectedVersion: string
- onEvent: {
- onmessage: (
- response:
- | { event: 'Started'; data: { contentLength?: number } }
- | { event: 'Progress'; data: { chunkLength: number } }
- | { event: 'Finished' },
- ) => void
- }
-}
-
-function makeUpdate(overrides: Partial<AppUpdateMetadata> = {}): AppUpdateMetadata {
- return {
- currentVersion: '2026.4.15',
- version: '2026.4.16',
- body: 'Bug fixes and improvements',
- ...overrides,
- }
-}
-
-function installInvokeHandlers({
- checkResult = null,
- downloadImpl,
-}: {
- checkResult?: AppUpdateMetadata | null | Error
- downloadImpl?: (args: DownloadArgs) => Promise<void>
-}) {
- mockInvoke.mockImplementation((command: string, args?: unknown) => {
- if (command === 'check_for_app_update') {
- if (checkResult instanceof Error) return Promise.reject(checkResult)
- return Promise.resolve(checkResult)
- }
-
- if (command === 'download_and_install_app_update') {
- if (downloadImpl) return downloadImpl(args as DownloadArgs)
- return Promise.resolve(null)
- }
-
- return Promise.resolve(null)
- })
-}
-
-function renderUpdater(releaseChannel: string, automaticChecksEnabled = true) {
- return renderHook(() => useUpdater(releaseChannel, automaticChecksEnabled))
-}
-
-async function performManualCheck(
- releaseChannel: string,
- checkResult: AppUpdateMetadata | null | Error,
-) {
- vi.mocked(isTauri).mockReturnValue(true)
- installInvokeHandlers({ checkResult })
-
- const hook = renderUpdater(releaseChannel)
- let outcome: string | undefined
-
- await act(async () => {
- outcome = await hook.result.current.actions.checkForUpdates()
- })
-
- return { result: hook.result, outcome }
-}
-
-async function advanceAutoCheck() {
- await act(async () => {
- await vi.advanceTimersByTimeAsync(3500)
- })
+function renderUpdater(automaticChecksEnabled = true) {
+ return renderHook(() => useUpdater('stable', automaticChecksEnabled))
}
describe('useUpdater', () => {
beforeEach(() => {
vi.useFakeTimers()
vi.clearAllMocks()
- clearRestartRequiredAfterUpdate()
- vi.spyOn(console, 'warn').mockImplementation(() => {})
})
afterEach(() => {
vi.useRealTimers()
- vi.restoreAllMocks()
- })
-
- it('starts in idle state', () => {
- vi.mocked(isTauri).mockReturnValue(false)
-
- const { result } = renderUpdater('stable')
-
- expect(result.current.status).toEqual({ state: 'idle' })
})
- it('does not check for updates when not running in Tauri', async () => {
- vi.mocked(isTauri).mockReturnValue(false)
-
- renderUpdater('stable')
- await advanceAutoCheck()
-
- expect(mockInvoke).not.toHaveBeenCalled()
+ it('starts in an idle state', () => {
+ expect(renderUpdater().result.current.status).toEqual({ state: 'idle' })
})
- it('checks for stable updates after the startup delay', async () => {
+ it('never schedules an updater request in the Guanghu distribution', async () => {
vi.mocked(isTauri).mockReturnValue(true)
- installInvokeHandlers({ checkResult: null })
- renderUpdater('stable')
- await advanceAutoCheck()
-
- expect(mockInvoke).toHaveBeenCalledWith('check_for_app_update', {
- releaseChannel: 'stable',
+ renderUpdater()
+ await act(async () => {
+ await vi.advanceTimersByTimeAsync(3500)
})
- })
-
- it('does not automatically check for updates when automatic checks are disabled', async () => {
- vi.mocked(isTauri).mockReturnValue(true)
- installInvokeHandlers({ checkResult: makeUpdate() })
-
- renderUpdater('stable', false)
- await advanceAutoCheck()
expect(mockInvoke).not.toHaveBeenCalled()
})
- it('keeps manual update checks available when automatic checks are disabled', async () => {
+ it('keeps a manual check local and idle', async () => {
vi.mocked(isTauri).mockReturnValue(true)
- installInvokeHandlers({ checkResult: null })
-
- const { result } = renderUpdater('stable', false)
+ const { result } = renderUpdater(false)
let outcome: unknown
await act(async () => {
outcome = await result.current.actions.checkForUpdates()
})
- expect(outcome).toEqual({ kind: 'up-to-date' })
- expect(mockInvoke).toHaveBeenCalledWith('check_for_app_update', {
- releaseChannel: 'stable',
- })
- })
-
- it('transitions to available when an alpha update is found', async () => {
- const { result } = await performManualCheck(
- 'alpha',
- makeUpdate({ version: '2026.4.16-alpha.3' }),
- )
-
- expect(result.current.status).toEqual({
- state: 'available',
- version: '2026.4.16-alpha.3',
- displayVersion: 'Alpha 2026.4.16.3',
- notes: 'Bug fixes and improvements',
- })
-
- expect(mockInvoke).toHaveBeenCalledWith('check_for_app_update', {
- releaseChannel: 'alpha',
- })
- })
-
- it('returns up-to-date when no update is available', async () => {
- const { result, outcome } = await performManualCheck('stable', null)
-
expect(outcome).toEqual({ kind: 'up-to-date' })
expect(result.current.status).toEqual({ state: 'idle' })
+ expect(mockInvoke).not.toHaveBeenCalled()
})
- it('shows checking state while a manual update check is in flight', async () => {
- vi.mocked(isTauri).mockReturnValue(true)
- let resolveCheck: (value: AppUpdateMetadata | null) => void = () => {}
- mockInvoke.mockImplementation((command: string) => {
- if (command === 'check_for_app_update') {
- return new Promise<AppUpdateMetadata | null>((resolve) => {
- resolveCheck = resolve
- })
- }
- return Promise.resolve(null)
- })
-
- const { result } = renderUpdater('stable')
+ it('does not download or restart from a disabled update channel', async () => {
+ const { result } = renderUpdater()
- let checkPromise: Promise<unknown> | null = null
await act(async () => {
- checkPromise = result.current.actions.checkForUpdates()
- await Promise.resolve()
- })
-
- expect(result.current.status).toEqual({ state: 'checking' })
-
- await act(async () => {
- resolveCheck(null)
- expect(await checkPromise).toEqual({ kind: 'up-to-date' })
+ await result.current.actions.startDownload()
})
expect(result.current.status).toEqual({ state: 'idle' })
+ expect(mockInvoke).not.toHaveBeenCalled()
})
- it('returns available and sets status when an update exists', async () => {
- const { result, outcome } = await performManualCheck(
- 'stable',
- makeUpdate({ body: undefined }),
- )
-
- expect(outcome).toEqual({
- kind: 'available',
- version: '2026.4.16',
- displayVersion: '2026.4.16',
- })
- expect(result.current.status).toEqual({
- state: 'available',
- version: '2026.4.16',
- displayVersion: '2026.4.16',
- notes: undefined,
- })
- })
-
- it('strips stable prerelease suffixes from the display version', async () => {
- const { result } = await performManualCheck(
- 'stable',
- makeUpdate({ version: '2026.4.16-stable.1' }),
- )
-
- expect(result.current.status).toEqual({
- state: 'available',
- version: '2026.4.16-stable.1',
- displayVersion: '2026.4.16',
- notes: 'Bug fixes and improvements',
- })
- })
-
- it('returns error when the update check fails', async () => {
- const { result, outcome } = await performManualCheck(
- 'stable',
- new Error('network error'),
- )
-
- expect(outcome).toEqual({
- kind: 'error',
- message: 'Could not check for updates: network error',
- })
- expect(console.warn).toHaveBeenCalledWith('[updater] Failed to check for updates')
- expect(result.current.status).toEqual({ state: 'error' })
- })
-
- it('dismiss resets the banner state', async () => {
- vi.mocked(isTauri).mockReturnValue(true)
- installInvokeHandlers({ checkResult: makeUpdate() })
-
- const { result } = renderUpdater('stable')
-
- await act(async () => {
- await result.current.actions.checkForUpdates()
- })
+ it('keeps dismiss as a safe idle-state reset', () => {
+ const { result } = renderUpdater()
act(() => {
result.current.actions.dismiss()
@@ -296,72 +82,13 @@ describe('useUpdater', () => {
expect(result.current.status).toEqual({ state: 'idle' })
})
- it('openReleaseNotes opens the release notes page', () => {
- vi.mocked(isTauri).mockReturnValue(false)
-
- const { result } = renderUpdater('stable')
+ it('opens release notes without enabling application updates', () => {
+ const { result } = renderUpdater()
act(() => {
result.current.actions.openReleaseNotes()
})
- expect(mockOpenExternalUrl).toHaveBeenCalledWith(
- 'https://tolaria.md/releases/'
- )
- })
-
- it('downloads and installs the available update with progress', async () => {
- vi.mocked(isTauri).mockReturnValue(true)
- installInvokeHandlers({
- checkResult: makeUpdate(),
- downloadImpl: async (args) => {
- expect(args.releaseChannel).toBe('stable')
- expect(args.expectedVersion).toBe('2026.4.16')
- args.onEvent.onmessage({ event: 'Started', data: { contentLength: 1000 } })
- args.onEvent.onmessage({ event: 'Progress', data: { chunkLength: 500 } })
- args.onEvent.onmessage({ event: 'Progress', data: { chunkLength: 500 } })
- args.onEvent.onmessage({ event: 'Finished' })
- },
- })
-
- const { result } = renderUpdater('stable')
-
- await act(async () => {
- await result.current.actions.checkForUpdates()
- })
-
- await act(async () => {
- await result.current.actions.startDownload()
- })
-
- expect(result.current.status).toEqual({
- state: 'ready',
- version: '2026.4.16',
- displayVersion: '2026.4.16',
- })
- expect(isRestartRequiredAfterUpdate()).toBe(true)
- })
-
- it('transitions to error when download fails', async () => {
- vi.mocked(isTauri).mockReturnValue(true)
- installInvokeHandlers({
- checkResult: makeUpdate(),
- downloadImpl: async () => {
- throw new Error('download failed')
- },
- })
-
- const { result } = renderUpdater('stable')
-
- await act(async () => {
- await result.current.actions.checkForUpdates()
- })
-
- await act(async () => {
- await result.current.actions.startDownload()
- })
-
- expect(console.warn).toHaveBeenCalledWith('[updater] Download failed')
- expect(result.current.status).toEqual({ state: 'error' })
+ expect(mockOpenExternalUrl).toHaveBeenCalledWith('https://tolaria.md/releases/')
})
})
diff --git a/src/hooks/useUpdater.ts b/src/hooks/useUpdater.ts
index c99843b66cc82d282ae96fee4b5b2115c7a6197b..f6bb8796f59995dc6417652f7a6206b89a03c2ea 100644
--- a/src/hooks/useUpdater.ts
+++ b/src/hooks/useUpdater.ts
@@ -10,6 +10,7 @@ import { formatCalendarVersionForDisplay } from '../utils/calendarVersion'
import { openExternalUrl } from '../utils/url'
const RELEASE_NOTES_URL = 'https://tolaria.md/releases/'
+const GUANGHU_UPDATES_ENABLED = false
interface UpdateVersionInfo {
version: string
@@ -99,12 +100,11 @@ export function useUpdater(
): { status: UpdateStatus; actions: UpdateActions } {
// Guanghu is an independent open-source fork. Until Guanghu has its own
// signed release feed, never contact or install from Tolaria's updater.
- const updatesEnabled = false
const [status, setStatus] = useState<UpdateStatus>({ state: 'idle' })
const updateRef = useRef<AppUpdateMetadata | null>(null)
const checkForUpdates = useCallback(async (): Promise<UpdateCheckResult> => {
- if (!updatesEnabled) return { kind: 'up-to-date' }
+ if (!GUANGHU_UPDATES_ENABLED) return { kind: 'up-to-date' }
if (!isTauri()) return { kind: 'up-to-date' }
setStatus({ state: 'checking' })
@@ -129,7 +129,7 @@ export function useUpdater(
}, [releaseChannel])
useEffect(() => {
- if (!updatesEnabled) return
+ if (!GUANGHU_UPDATES_ENABLED) return
if (!automaticChecksEnabled) return
if (!isTauri()) return
const timer = setTimeout(() => { checkForUpdates() }, 3000)
@@ -137,7 +137,7 @@ export function useUpdater(
}, [automaticChecksEnabled, checkForUpdates])
const startDownload = useCallback(async () => {
- if (!updatesEnabled) return
+ if (!GUANGHU_UPDATES_ENABLED) return
const update = updateRef.current
if (!update) return
--
2.50.1 (Apple Git-155)

View file

@ -0,0 +1,635 @@
From edf46c67334ed8bd5adbb0be719ab0dd51ffa266 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com>
Date: Thu, 16 Jul 2026 22:30:25 +0800
Subject: [PATCH 5/7] Add portable callout page blocks
---
src/components/Editor.css | 62 +++++++++++
src/components/editorSchema.tsx | 46 ++++++++
.../tolariaEditorFormatting.test.tsx | 58 ++++++++++
.../tolariaEditorFormattingConfig.ts | 101 +++++++++++++++++-
src/utils/blockNoteDirectMarkdown.test.ts | 12 +++
src/utils/blockNoteDirectMarkdown.ts | 12 +++
src/utils/calloutMarkdown.ts | 70 ++++++++++++
src/utils/editorDurableMarkdown.test.ts | 17 +++
src/utils/editorDurableMarkdown.ts | 3 +-
9 files changed, 379 insertions(+), 2 deletions(-)
create mode 100644 src/utils/calloutMarkdown.ts
diff --git a/src/components/Editor.css b/src/components/Editor.css
index 24f0738..5db3fe1 100644
--- a/src/components/Editor.css
+++ b/src/components/Editor.css
@@ -80,6 +80,68 @@
line-height: 1.65;
}
+.tolaria-callout {
+ --tolaria-callout-accent: #2563eb;
+ --tolaria-callout-bg: color-mix(in srgb, #2563eb 9%, var(--bg-primary));
+ display: grid;
+ grid-template-columns: 4px minmax(0, 1fr);
+ gap: 12px;
+ width: 100%;
+ margin: 0.45rem 0;
+ padding: 11px 13px 11px 0;
+ border: 1px solid color-mix(in srgb, var(--tolaria-callout-accent) 28%, var(--border));
+ border-radius: 8px;
+ background: var(--tolaria-callout-bg);
+}
+
+.tolaria-callout[data-kind="success"] {
+ --tolaria-callout-accent: #168a48;
+ --tolaria-callout-bg: color-mix(in srgb, #168a48 10%, var(--bg-primary));
+}
+
+.tolaria-callout[data-kind="warning"] {
+ --tolaria-callout-accent: #b7791f;
+ --tolaria-callout-bg: color-mix(in srgb, #b7791f 13%, var(--bg-primary));
+}
+
+.tolaria-callout[data-kind="danger"] {
+ --tolaria-callout-accent: #dc2626;
+ --tolaria-callout-bg: color-mix(in srgb, #dc2626 10%, var(--bg-primary));
+}
+
+.tolaria-callout__marker {
+ width: 4px;
+ min-height: 100%;
+ border-radius: 999px;
+ background: var(--tolaria-callout-accent);
+}
+
+.tolaria-callout__body {
+ display: grid;
+ gap: 4px;
+ min-width: 0;
+}
+
+.tolaria-callout__label {
+ color: var(--tolaria-callout-accent);
+ font-size: 11px;
+ font-weight: 700;
+ line-height: 1.2;
+ text-transform: uppercase;
+}
+
+.tolaria-callout__content {
+ min-width: 0;
+ color: var(--text-primary);
+ font-size: 14px;
+ line-height: 1.6;
+}
+
+.tolaria-callout__content:empty::before {
+ color: var(--text-muted);
+ content: 'Write a note';
+}
+
/* Breadcrumb bar: border can still react to the data attribute, but the
breadcrumb filename/title stays visible at all times. */
.breadcrumb-bar {
diff --git a/src/components/editorSchema.tsx b/src/components/editorSchema.tsx
index 2984eff..7d62518 100644
--- a/src/components/editorSchema.tsx
+++ b/src/components/editorSchema.tsx
@@ -25,6 +25,11 @@ import { MERMAID_BLOCK_TYPE, mermaidFenceSource } from '../utils/mermaidMarkdown
import { TLDRAW_BLOCK_TYPE, TLDRAW_DEFAULT_HEIGHT } from '../utils/tldrawMarkdown'
import { MARKDOWN_HIGHLIGHT_STYLE } from '../utils/markdownHighlightMarkdown'
import { GUANGHU_PORTAL_BLOCK_TYPE } from '../utils/guanghuPortalMarkdown'
+import {
+ calloutKind,
+ TOLARIA_CALLOUT_BLOCK_TYPE,
+ type TolariaCalloutKind,
+} from '../utils/calloutMarkdown'
import type { VaultEntry } from '../types'
import { createTolariaCodeBlockOptions } from './codeBlockOptions'
import { NoteTitleIcon } from './NoteTitleIcon'
@@ -350,6 +355,45 @@ const GuanghuPortalBlock = createReactBlockSpec(
},
)
+const CALLOUT_LABELS: Record<TolariaCalloutKind, string> = {
+ danger: 'Danger',
+ info: 'Info',
+ success: 'Success',
+ warning: 'Warning',
+}
+
+function TolariaCalloutRenderer({
+ block,
+ contentRef,
+}: {
+ block: { props: { kind?: string } }
+ contentRef: (node: HTMLElement | null) => void
+}) {
+ const kind = calloutKind(block.props.kind)
+ return (
+ <aside className="tolaria-callout" data-kind={kind}>
+ <span className="tolaria-callout__marker" aria-hidden="true" />
+ <div className="tolaria-callout__body">
+ <span className="tolaria-callout__label">{CALLOUT_LABELS[kind]}</span>
+ <div ref={contentRef} className="tolaria-callout__content" />
+ </div>
+ </aside>
+ )
+}
+
+const TolariaCalloutBlock = createReactBlockSpec(
+ {
+ type: TOLARIA_CALLOUT_BLOCK_TYPE,
+ propSchema: {
+ kind: { default: 'info' },
+ },
+ content: 'inline',
+ },
+ {
+ render: TolariaCalloutRenderer,
+ },
+)
+
export function mediaBlockPropsForPreviewRuntime<T extends MediaBlockPreviewProps>(
props: T,
externalMediaPreview: boolean,
@@ -450,6 +494,7 @@ const codeBlock = createCodeBlockSpec(createTolariaCodeBlockOptions())
const audioBlock = AudioBlockSpec()
const mathBlock = MathBlock()
const guanghuPortalBlock = GuanghuPortalBlock()
+const tolariaCalloutBlock = TolariaCalloutBlock()
const mermaidBlock = MermaidBlock()
const tldrawBlock = TldrawBlock()
const videoBlock = VideoBlockSpec()
@@ -485,6 +530,7 @@ export const schema = BlockNoteSchema.create({
blockSpecs: {
audio: audioBlock,
guanghuPortalBlock,
+ [TOLARIA_CALLOUT_BLOCK_TYPE]: tolariaCalloutBlock,
mathBlock,
mermaidBlock,
tldrawBlock,
diff --git a/src/components/tolariaEditorFormatting.test.tsx b/src/components/tolariaEditorFormatting.test.tsx
index 5c5143b..7bd06c2 100644
--- a/src/components/tolariaEditorFormatting.test.tsx
+++ b/src/components/tolariaEditorFormatting.test.tsx
@@ -7,7 +7,9 @@ vi.mock('../lib/telemetry', () => ({
}))
import {
+ addItemsAfterKey,
addItemsToMediaGroup,
+ createCalloutSlashMenuItems,
createMathSlashMenuItem,
filterTolariaFormattingToolbarItems,
filterTolariaSlashMenuItems,
@@ -18,6 +20,7 @@ import {
import { trackEvent } from '../lib/telemetry'
import { MATH_BLOCK_TYPE } from '../utils/mathMarkdown'
import { mermaidFenceSource } from '../utils/mermaidMarkdown'
+import { TOLARIA_CALLOUT_BLOCK_TYPE } from '../utils/calloutMarkdown'
describe('tolariaEditorFormatting', () => {
it('keeps the markdown-safe toolbar controls and block type select', () => {
@@ -73,6 +76,7 @@ describe('tolariaEditorFormatting', () => {
{ key: 'heading_4', title: 'Heading 4', onItemClick: () => {} },
{ key: 'bullet_list', title: 'Bullet List', subtext: 'Default list copy', onItemClick: () => {} },
{ key: 'code_block', title: 'Code Block', subtext: 'Default code copy', onItemClick: () => {} },
+ { key: 'tolaria_callout_info', title: 'Info callout', onItemClick: () => {} },
{ key: 'heading_5', title: 'Heading 5', onItemClick: () => {} },
{ key: 'heading_6', title: 'Heading 6', onItemClick: () => {} },
] satisfies TolariaSlashMenuTestItem[])
@@ -82,12 +86,14 @@ describe('tolariaEditorFormatting', () => {
'heading_4',
'bullet_list',
'code_block',
+ 'tolaria_callout_info',
])
expect(items.map((item) => item.subtext)).toEqual([
undefined,
undefined,
undefined,
undefined,
+ undefined,
])
})
@@ -224,6 +230,58 @@ describe('tolariaEditorFormatting', () => {
])
})
+ it('places callout commands after quote blocks', () => {
+ type TolariaSlashMenuTestItem = {
+ key: string
+ title: string
+ group: string
+ onItemClick: () => void
+ }
+
+ const items = addItemsAfterKey([
+ { key: 'paragraph', title: 'Paragraph', group: 'Basic blocks', onItemClick: () => {} },
+ { key: 'quote', title: 'Quote', group: 'Basic blocks', onItemClick: () => {} },
+ { key: 'code_block', title: 'Code Block', group: 'Basic blocks', onItemClick: () => {} },
+ ] satisfies TolariaSlashMenuTestItem[], 'quote', [
+ { key: 'tolaria_callout_info', title: 'Info callout', group: 'Basic blocks', onItemClick: () => {} },
+ ])
+
+ expect(items.map(item => item.key)).toEqual([
+ 'paragraph',
+ 'quote',
+ 'tolaria_callout_info',
+ 'code_block',
+ ])
+ })
+
+ it('keeps callout slash commands searchable and inserts an editable callout block', async () => {
+ const block = { id: 'active-block' }
+ const editor = {
+ getTextCursorPosition: () => ({ block }),
+ replaceBlocks: () => {},
+ }
+ const replaceBlocks = vi.spyOn(editor, 'replaceBlocks')
+ const items = createCalloutSlashMenuItems(editor as never)
+ const warningItem = items.find(item => item.key === 'tolaria_callout_warning')
+
+ expect(warningItem).toEqual(expect.objectContaining({
+ title: 'Warning callout',
+ aliases: expect.arrayContaining(['warning', '警告']),
+ }))
+
+ warningItem?.onItemClick()
+
+ expect(replaceBlocks).toHaveBeenCalledWith([block], [{
+ type: TOLARIA_CALLOUT_BLOCK_TYPE,
+ props: { kind: 'warning' },
+ content: [{
+ type: 'text',
+ text: 'Warning callout',
+ styles: {},
+ }],
+ }])
+ })
+
it('creates a math slash command with a default display equation', () => {
const block = { id: 'active-block' }
const editor = {
diff --git a/src/components/tolariaEditorFormattingConfig.ts b/src/components/tolariaEditorFormattingConfig.ts
index b55dede..614cbf5 100644
--- a/src/components/tolariaEditorFormattingConfig.ts
+++ b/src/components/tolariaEditorFormattingConfig.ts
@@ -6,9 +6,11 @@ import {
import { createElement, type ReactElement } from 'react'
import {
CodeBlock,
+ CheckCircle,
File,
FlowArrow,
ImageSquare,
+ Info,
ListBullets,
ListChecks,
ListNumbers,
@@ -26,6 +28,8 @@ import {
TextHFour,
TextHFive,
TextHSix,
+ Warning,
+ XCircle,
Video,
type Icon as PhosphorIcon,
} from '@phosphor-icons/react'
@@ -38,6 +42,10 @@ import {
import { MATH_BLOCK_TYPE } from '../utils/mathMarkdown'
import { MERMAID_BLOCK_TYPE, mermaidFenceSource } from '../utils/mermaidMarkdown'
import { TLDRAW_BLOCK_TYPE, TLDRAW_DEFAULT_HEIGHT } from '../utils/tldrawMarkdown'
+import {
+ TOLARIA_CALLOUT_BLOCK_TYPE,
+ type TolariaCalloutKind,
+} from '../utils/calloutMarkdown'
type TolariaSlashMenuItem = DefaultReactSuggestionItem & { key: string }
type TolariaBlockTypeSelectItem = RichEditorBlockTypeDefinition & {
@@ -55,6 +63,12 @@ type BlockSlashMenuItemConfig = {
title: string
type: string
}
+type CalloutSlashMenuItemConfig = {
+ aliases: string[]
+ key: string
+ kind: TolariaCalloutKind
+ title: string
+}
type TolariaSlashMenuLabels = {
mathTitle: string
}
@@ -115,6 +129,10 @@ const TOLARIA_SLASH_MENU_ICONS: Partial<Record<string, PhosphorIcon>> = {
numbered_list: ListNumbers,
paragraph: Paragraph,
quote: Quotes,
+ tolaria_callout_danger: XCircle,
+ tolaria_callout_info: Info,
+ tolaria_callout_success: CheckCircle,
+ tolaria_callout_warning: Warning,
table: Table,
toggle_heading: TextHOne,
toggle_heading_2: TextHTwo,
@@ -164,6 +182,64 @@ function createMermaidSlashMenuItem(
})
}
+function createCalloutSlashMenuItem(
+ editor: Parameters<typeof getDefaultReactSlashMenuItems>[0],
+ config: CalloutSlashMenuItemConfig,
+): TolariaSlashMenuItem {
+ const blockEditor = editor as unknown as SlashInsertEditor
+
+ return {
+ key: config.key,
+ title: config.title,
+ aliases: config.aliases,
+ group: 'Basic blocks',
+ onItemClick: () => {
+ const block = blockEditor.getTextCursorPosition().block
+ blockEditor.replaceBlocks([block], [{
+ type: TOLARIA_CALLOUT_BLOCK_TYPE,
+ props: { kind: config.kind },
+ content: [{
+ type: 'text',
+ text: config.title,
+ styles: {},
+ }],
+ }])
+ trackEvent('editor_callout_slash_command_used', { kind: config.kind })
+ },
+ } as TolariaSlashMenuItem
+}
+
+export function createCalloutSlashMenuItems(
+ editor: Parameters<typeof getDefaultReactSlashMenuItems>[0],
+): TolariaSlashMenuItem[] {
+ return [
+ createCalloutSlashMenuItem(editor, {
+ key: 'tolaria_callout_info',
+ title: 'Info callout',
+ aliases: ['callout', 'note', 'info', 'tip', '提示', '高亮'],
+ kind: 'info',
+ }),
+ createCalloutSlashMenuItem(editor, {
+ key: 'tolaria_callout_success',
+ title: 'Success callout',
+ aliases: ['callout', 'success', 'done', 'ok', '完成', '成功'],
+ kind: 'success',
+ }),
+ createCalloutSlashMenuItem(editor, {
+ key: 'tolaria_callout_warning',
+ title: 'Warning callout',
+ aliases: ['callout', 'warning', 'alert', 'todo', '警告', '注意'],
+ kind: 'warning',
+ }),
+ createCalloutSlashMenuItem(editor, {
+ key: 'tolaria_callout_danger',
+ title: 'Danger callout',
+ aliases: ['callout', 'danger', 'risk', 'error', '风险', '危险'],
+ kind: 'danger',
+ }),
+ ]
+}
+
export function createMathSlashMenuItem(
editor: Parameters<typeof getDefaultReactSlashMenuItems>[0],
labels: TolariaSlashMenuLabels = { mathTitle: 'Math' },
@@ -218,6 +294,23 @@ export function addItemsToMediaGroup(
return nextItems
}
+export function addItemsAfterKey(
+ items: TolariaSlashMenuItem[],
+ insertAfterKey: string,
+ insertedItems: TolariaSlashMenuItem[],
+): TolariaSlashMenuItem[] {
+ const nextItems = [...items]
+ const insertIndex = nextItems.findIndex((item) => item.key === insertAfterKey)
+
+ if (insertIndex === -1) {
+ nextItems.unshift(...insertedItems)
+ return nextItems
+ }
+
+ nextItems.splice(insertIndex + 1, 0, ...insertedItems)
+ return nextItems
+}
+
function createTolariaSlashMenuIcon(Icon: PhosphorIcon) {
return createElement(
'span',
@@ -273,8 +366,14 @@ export function getTolariaSlashMenuItems(
query: string,
labels?: TolariaSlashMenuLabels,
) {
+ const defaultItems = getDefaultReactSlashMenuItems(editor) as TolariaSlashMenuItem[]
+ const itemsWithCallouts = addItemsAfterKey(
+ defaultItems,
+ 'quote',
+ createCalloutSlashMenuItems(editor),
+ )
const items = addItemsToMediaGroup(
- getDefaultReactSlashMenuItems(editor) as TolariaSlashMenuItem[],
+ itemsWithCallouts,
[
createMermaidSlashMenuItem(editor),
createMathSlashMenuItem(editor, labels),
diff --git a/src/utils/blockNoteDirectMarkdown.test.ts b/src/utils/blockNoteDirectMarkdown.test.ts
index 524b29c..cabba60 100644
--- a/src/utils/blockNoteDirectMarkdown.test.ts
+++ b/src/utils/blockNoteDirectMarkdown.test.ts
@@ -5,6 +5,7 @@ import {
serializeBlockNoteMarkdown,
type DirectMarkdownCapableSerializer,
} from './blockNoteDirectMarkdown'
+import { TOLARIA_CALLOUT_BLOCK_TYPE } from './calloutMarkdown'
import { serializeRichEditorBodyToMarkdown } from './richEditorMarkdown'
function makeEditor(document: unknown[]): DirectMarkdownCapableSerializer & { document: unknown[] } {
@@ -117,6 +118,17 @@ describe('BlockNote direct Markdown serialization', () => {
].join('\n'))
})
+ it('serializes Tolaria callout blocks as portable Markdown callouts', () => {
+ expect(blocksToMarkdownDirect([
+ {
+ type: TOLARIA_CALLOUT_BLOCK_TYPE,
+ props: { kind: 'success' },
+ content: [{ type: 'text', text: 'Package is ready', styles: {} }],
+ children: [],
+ },
+ ]).markdown).toBe('> [!success] Package is ready')
+ })
+
it('caches unchanged block objects across rich-editor body serialization', () => {
const block = {
type: 'paragraph',
diff --git a/src/utils/blockNoteDirectMarkdown.ts b/src/utils/blockNoteDirectMarkdown.ts
index c075831..2ac99a0 100644
--- a/src/utils/blockNoteDirectMarkdown.ts
+++ b/src/utils/blockNoteDirectMarkdown.ts
@@ -1,3 +1,5 @@
+import { calloutKind, TOLARIA_CALLOUT_BLOCK_TYPE } from './calloutMarkdown'
+
interface TextStyles {
[style: string]: string | boolean | undefined
}
@@ -228,6 +230,15 @@ function quoteMarkdown(block: BlockLike): string {
return text.split('\n').map(line => `> ${line}`).join('\n')
}
+function calloutMarkdown(block: BlockLike): string {
+ const kind = calloutKind(block.props?.kind)
+ const text = serializeInlineContent(contentArray(block.content)) || 'Write a note'
+ return `[!${kind}] ${text}`
+ .split('\n')
+ .map(line => `> ${line}`)
+ .join('\n')
+}
+
function tableCellMarkdown(cell: TableCellValue): string {
const text = typeof cell === 'string'
? cell
@@ -273,6 +284,7 @@ const BLOCK_MARKDOWN_HANDLERS: Record<string, BlockMarkdownHandler> = {
heading: headingMarkdown,
quote: quoteMarkdown,
table: tableMarkdown,
+ [TOLARIA_CALLOUT_BLOCK_TYPE]: calloutMarkdown,
}
function blockMarkdownWithoutChildren(block: BlockLike, context: SerializeContext): string | null {
diff --git a/src/utils/calloutMarkdown.ts b/src/utils/calloutMarkdown.ts
new file mode 100644
index 0000000..b6881b6
--- /dev/null
+++ b/src/utils/calloutMarkdown.ts
@@ -0,0 +1,70 @@
+import type { BlockLike } from './durableMarkdownBlocks'
+
+export const TOLARIA_CALLOUT_BLOCK_TYPE = 'tolariaCallout'
+
+export const TOLARIA_CALLOUT_KINDS = ['info', 'success', 'warning', 'danger'] as const
+
+export type TolariaCalloutKind = typeof TOLARIA_CALLOUT_KINDS[number]
+
+const CALLOUT_MARKER_RE = /^\[!(info|success|warning|danger)\]\s*(.*)$/iu
+
+function isCalloutKind(value: unknown): value is TolariaCalloutKind {
+ return typeof value === 'string' && TOLARIA_CALLOUT_KINDS.includes(value as TolariaCalloutKind)
+}
+
+function readTextOnlyContent(content: BlockLike['content']): string | null {
+ if (!Array.isArray(content) || content.length === 0) return null
+
+ let text = ''
+ for (const item of content) {
+ if (item.type !== 'text' || typeof item.text !== 'string') return null
+ text += item.text
+ }
+ return text
+}
+
+function calloutMatchFromQuote(block: BlockLike) {
+ if (block.type !== 'quote') return null
+
+ const text = readTextOnlyContent(block.content)
+ if (text === null) return null
+
+ const match = CALLOUT_MARKER_RE.exec(text)
+ if (!match) return null
+
+ const kind = match[1]?.toLowerCase()
+ if (!isCalloutKind(kind)) return null
+
+ return {
+ kind,
+ text: match[2] ?? '',
+ }
+}
+
+export function injectTolariaCalloutBlocks(blocks: unknown[]): unknown[] {
+ return (blocks as BlockLike[]).map((block) => {
+ const match = calloutMatchFromQuote(block)
+ const children = Array.isArray(block.children)
+ ? injectTolariaCalloutBlocks(block.children) as BlockLike[]
+ : block.children
+
+ if (!match) return { ...block, children }
+
+ return {
+ ...block,
+ type: TOLARIA_CALLOUT_BLOCK_TYPE,
+ props: {
+ ...(block.props ?? {}),
+ kind: match.kind,
+ },
+ content: match.text
+ ? [{ type: 'text', text: match.text, styles: {} }]
+ : [],
+ children,
+ }
+ })
+}
+
+export function calloutKind(value: unknown): TolariaCalloutKind {
+ return isCalloutKind(value) ? value : 'info'
+}
diff --git a/src/utils/editorDurableMarkdown.test.ts b/src/utils/editorDurableMarkdown.test.ts
index f5a230d..4e6679e 100644
--- a/src/utils/editorDurableMarkdown.test.ts
+++ b/src/utils/editorDurableMarkdown.test.ts
@@ -6,6 +6,7 @@ import {
preProcessDurableEditorMarkdown,
serializeDurableEditorBlocks,
} from './editorDurableMarkdown'
+import { TOLARIA_CALLOUT_BLOCK_TYPE } from './calloutMarkdown'
import { MERMAID_BLOCK_TYPE } from './mermaidMarkdown'
import { TLDRAW_BLOCK_TYPE } from './tldrawMarkdown'
@@ -70,4 +71,20 @@ describe('editor durable markdown blocks', () => {
},
})
})
+
+ it('restores Markdown callouts as Tolaria page blocks', () => {
+ const blocks = injectDurableEditorMarkdownBlocks([
+ {
+ type: 'quote',
+ content: [{ type: 'text', text: '[!warning] Check signing before sharing.', styles: {} }],
+ children: [],
+ },
+ ]) as Array<{ type: string; props?: Record<string, string>; content?: Array<{ text?: string }> }>
+
+ expect(blocks[0]).toMatchObject({
+ type: TOLARIA_CALLOUT_BLOCK_TYPE,
+ props: { kind: 'warning' },
+ content: [{ text: 'Check signing before sharing.' }],
+ })
+ })
})
diff --git a/src/utils/editorDurableMarkdown.ts b/src/utils/editorDurableMarkdown.ts
index 6e6d30a..baa5670 100644
--- a/src/utils/editorDurableMarkdown.ts
+++ b/src/utils/editorDurableMarkdown.ts
@@ -16,6 +16,7 @@ import { serializeMathAwareBlocks } from './mathMarkdown'
import { mermaidMarkdownCodec } from './mermaidMarkdown'
import { tldrawMarkdownCodec } from './tldrawMarkdown'
import { guanghuPortalMarkdownCodec } from './guanghuPortalMarkdown'
+import { injectTolariaCalloutBlocks } from './calloutMarkdown'
const EDITOR_DURABLE_MARKDOWN_CODECS = [
guanghuPortalMarkdownCodec,
@@ -36,7 +37,7 @@ export function injectDurableEditorMarkdownBlocks(blocks: unknown[]): unknown[]
blocks,
codecs: EDITOR_DURABLE_MARKDOWN_CODECS,
})
- return injectFileAttachmentBlocks(withDurableBlocks)
+ return injectTolariaCalloutBlocks(injectFileAttachmentBlocks(withDurableBlocks))
}
export function serializeDurableEditorBlocks(
--
2.50.1 (Apple Git-155)

View file

@ -0,0 +1,134 @@
From 9fc5e885742a48c2794a4b4fcd8ddae66501aa28 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com>
Date: Fri, 17 Jul 2026 10:30:04 +0800
Subject: [PATCH 6/7] fix: make Guanghu home and themes visible
---
src/App.tsx | 4 ++--
src/components/HoloLakeHome.tsx | 1 +
src/hooks/useGuanghuTheme.test.ts | 30 ++++++++++++++++++++++++++++++
src/hooks/useGuanghuTheme.ts | 12 +++++++++++-
src/lib/guanghuTheme.ts | 6 +++---
5 files changed, 47 insertions(+), 6 deletions(-)
create mode 100644 src/hooks/useGuanghuTheme.test.ts
diff --git a/src/App.tsx b/src/App.tsx
index 2b4ef17..66c879d 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -170,8 +170,7 @@ function App() {
function MainApp({ noteWindowParams }: { noteWindowParams: NoteWindowParams | null }) {
const aiWorkspaceWindow = false
- const [showHoloLakeHome, setShowHoloLakeHome] = useState(false)
- const { theme: guanghuTheme, cycleTheme } = useGuanghuTheme()
+ const [showHoloLakeHome, setShowHoloLakeHome] = useState(true)
const { dragRegionRef } = useDragRegion<HTMLElement>()
const [selection, setSelection] = useState<SidebarSelection>(DEFAULT_SELECTION)
const [noteListFilter, setNoteListFilter] = useState<NoteListFilter>('open')
@@ -426,6 +425,7 @@ function MainApp({ noteWindowParams }: { noteWindowParams: NoteWindowParams | nu
settings,
settingsLoaded,
})
+ const { theme: guanghuTheme, cycleTheme } = useGuanghuTheme()
const quickPromptTarget = lastAiWorkspaceTarget ?? aiAgentPreferences.defaultAiTarget
const quickPromptTargetReady = aiTargetReady(quickPromptTarget, aiAgentsStatus)
diff --git a/src/components/HoloLakeHome.tsx b/src/components/HoloLakeHome.tsx
index 86b2891..49127ca 100644
--- a/src/components/HoloLakeHome.tsx
+++ b/src/components/HoloLakeHome.tsx
@@ -4,6 +4,7 @@ type HoloLakeHomeProps = {
const modules = [
['知识湖', '把代码仓库、文档与路径转译成可阅读、可追溯的知识页面。', '进入知识库'],
+ ['页面组件', '提示块、批注、关系卡、路径包、折叠块与高亮代码已接入笔记编辑器。', '在笔记中输入 /'],
['协作空间', '人类与人格体在同一上下文中对话、确认、留存回执。', '筹备中'],
['授权中心', '任何真实操作先形成可读计划,再由人类一次确认。', '筹备中'],
]
diff --git a/src/hooks/useGuanghuTheme.test.ts b/src/hooks/useGuanghuTheme.test.ts
new file mode 100644
index 0000000..8fa948a
--- /dev/null
+++ b/src/hooks/useGuanghuTheme.test.ts
@@ -0,0 +1,30 @@
+import { act, renderHook } from '@testing-library/react'
+import { beforeEach, describe, expect, it } from 'vitest'
+import { GUANGHU_THEME_STORAGE_KEY } from '../lib/guanghuTheme'
+import { THEME_MODE_STORAGE_KEY } from '../lib/themeMode'
+import { useGuanghuTheme } from './useGuanghuTheme'
+
+describe('useGuanghuTheme', () => {
+ beforeEach(() => {
+ window.localStorage.clear()
+ document.documentElement.removeAttribute('data-guanghu-theme')
+ document.documentElement.removeAttribute('data-theme')
+ document.documentElement.classList.remove('dark')
+ })
+
+ it('makes the lake presets visibly switch the document between light and dark', () => {
+ window.localStorage.setItem(GUANGHU_THEME_STORAGE_KEY, 'lake-light')
+ const { result } = renderHook(() => useGuanghuTheme())
+
+ expect(document.documentElement).toHaveAttribute('data-guanghu-theme', 'lake-light')
+ expect(document.documentElement).toHaveAttribute('data-theme', 'light')
+ expect(window.localStorage.getItem(THEME_MODE_STORAGE_KEY)).toBe('light')
+
+ act(() => result.current.cycleTheme())
+
+ expect(document.documentElement).toHaveAttribute('data-guanghu-theme', 'lake-dark')
+ expect(document.documentElement).toHaveAttribute('data-theme', 'dark')
+ expect(document.documentElement).toHaveClass('dark')
+ expect(window.localStorage.getItem(THEME_MODE_STORAGE_KEY)).toBe('dark')
+ })
+})
diff --git a/src/hooks/useGuanghuTheme.ts b/src/hooks/useGuanghuTheme.ts
index 2c42f2d..ec175ce 100644
--- a/src/hooks/useGuanghuTheme.ts
+++ b/src/hooks/useGuanghuTheme.ts
@@ -6,6 +6,16 @@ import {
writeGuanghuTheme,
type GuanghuTheme,
} from '../lib/guanghuTheme'
+import { applyThemeModeToDocument, writeStoredThemeMode } from '../lib/themeMode'
+
+function applyGuanghuTheme(theme: GuanghuTheme): void {
+ document.documentElement.setAttribute('data-guanghu-theme', theme)
+ if (theme === 'native') return
+
+ const mode = theme === 'lake-light' ? 'light' : 'dark'
+ applyThemeModeToDocument(document, mode)
+ writeStoredThemeMode(window.localStorage, mode)
+}
export function useGuanghuTheme(): { theme: GuanghuTheme; cycleTheme: () => void } {
const [theme, setTheme] = useState<GuanghuTheme>(() => (
@@ -13,7 +23,7 @@ export function useGuanghuTheme(): { theme: GuanghuTheme; cycleTheme: () => void
))
useEffect(() => {
- document.documentElement.setAttribute('data-guanghu-theme', theme)
+ applyGuanghuTheme(theme)
writeGuanghuTheme(window.localStorage, theme)
}, [theme])
diff --git a/src/lib/guanghuTheme.ts b/src/lib/guanghuTheme.ts
index 711a589..7ed2806 100644
--- a/src/lib/guanghuTheme.ts
+++ b/src/lib/guanghuTheme.ts
@@ -4,9 +4,9 @@ export const GUANGHU_THEMES = ['native', 'lake-light', 'lake-dark'] as const
export type GuanghuTheme = typeof GUANGHU_THEMES[number]
export const GUANGHU_THEME_LABELS: Record<GuanghuTheme, string> = {
- native: '原生',
- 'lake-light': '湖光浅色',
- 'lake-dark': '湖心深色',
+ native: '跟随原生',
+ 'lake-light': '湖光浅色(亮)',
+ 'lake-dark': '湖心深色(暗)',
}
export function normalizeGuanghuTheme(value: unknown): GuanghuTheme {
--
2.50.1 (Apple Git-155)

View file

@ -0,0 +1,216 @@
From 2b57543d7855487e75d52fce12714501811fb650 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com>
Date: Fri, 17 Jul 2026 10:30:04 +0800
Subject: [PATCH 7/7] feat: complete portable page block set
---
src/components/Editor.css | 16 +++++++++++
src/components/editorSchema.tsx | 3 +++
.../tolariaEditorFormatting.test.tsx | 12 ++++++++-
.../tolariaEditorFormattingConfig.ts | 27 ++++++++++++++++---
src/utils/blockNoteDirectMarkdown.test.ts | 9 +++++++
src/utils/calloutMarkdown.ts | 12 +++++++--
6 files changed, 72 insertions(+), 7 deletions(-)
diff --git a/src/components/Editor.css b/src/components/Editor.css
index 5db3fe1..11a0813 100644
--- a/src/components/Editor.css
+++ b/src/components/Editor.css
@@ -109,6 +109,22 @@
--tolaria-callout-bg: color-mix(in srgb, #dc2626 10%, var(--bg-primary));
}
+.tolaria-callout[data-kind="annotation"] {
+ --tolaria-callout-accent: #8b5cf6;
+ --tolaria-callout-bg: color-mix(in srgb, #8b5cf6 11%, var(--bg-primary));
+}
+
+.tolaria-callout[data-kind="relationship"] {
+ --tolaria-callout-accent: #0f9f8f;
+ --tolaria-callout-bg: color-mix(in srgb, #0f9f8f 11%, var(--bg-primary));
+}
+
+.tolaria-callout[data-kind="path"] {
+ --tolaria-callout-accent: #4f7ecb;
+ --tolaria-callout-bg: color-mix(in srgb, #4f7ecb 11%, var(--bg-primary));
+ border-style: dashed;
+}
+
.tolaria-callout__marker {
width: 4px;
min-height: 100%;
diff --git a/src/components/editorSchema.tsx b/src/components/editorSchema.tsx
index 7d62518..75ceddf 100644
--- a/src/components/editorSchema.tsx
+++ b/src/components/editorSchema.tsx
@@ -356,8 +356,11 @@ const GuanghuPortalBlock = createReactBlockSpec(
)
const CALLOUT_LABELS: Record<TolariaCalloutKind, string> = {
+ annotation: '批注',
danger: 'Danger',
info: 'Info',
+ path: '路径',
+ relationship: '关系',
success: 'Success',
warning: 'Warning',
}
diff --git a/src/components/tolariaEditorFormatting.test.tsx b/src/components/tolariaEditorFormatting.test.tsx
index 7bd06c2..b32ebb7 100644
--- a/src/components/tolariaEditorFormatting.test.tsx
+++ b/src/components/tolariaEditorFormatting.test.tsx
@@ -60,7 +60,7 @@ describe('tolariaEditorFormatting', () => {
])
})
- it('filters unsupported toggle slash-menu variants and removes command descriptions', () => {
+ it('keeps Notion-style toggles, filters oversized headings, and removes command descriptions', () => {
type TolariaSlashMenuTestItem = {
key: string
title: string
@@ -82,6 +82,8 @@ describe('tolariaEditorFormatting', () => {
] satisfies TolariaSlashMenuTestItem[])
expect(items.map((item) => item.key)).toEqual([
+ 'toggle_heading',
+ 'toggle_list',
'heading',
'heading_4',
'bullet_list',
@@ -94,6 +96,8 @@ describe('tolariaEditorFormatting', () => {
undefined,
undefined,
undefined,
+ undefined,
+ undefined,
])
})
@@ -280,6 +284,12 @@ describe('tolariaEditorFormatting', () => {
styles: {},
}],
}])
+
+ expect(items.map(item => item.key)).toEqual(expect.arrayContaining([
+ 'tolaria_callout_annotation',
+ 'tolaria_callout_relationship',
+ 'tolaria_callout_path',
+ ]))
})
it('creates a math slash command with a default display equation', () => {
diff --git a/src/components/tolariaEditorFormattingConfig.ts b/src/components/tolariaEditorFormattingConfig.ts
index 614cbf5..41d9225 100644
--- a/src/components/tolariaEditorFormattingConfig.ts
+++ b/src/components/tolariaEditorFormattingConfig.ts
@@ -9,6 +9,7 @@ import {
CheckCircle,
File,
FlowArrow,
+ GitBranch,
ImageSquare,
Info,
ListBullets,
@@ -21,6 +22,7 @@ import {
ScribbleLoop,
Smiley,
SpeakerHigh,
+ Tag,
Table,
TextHOne,
TextHTwo,
@@ -90,10 +92,6 @@ const UNSUPPORTED_FORMATTING_TOOLBAR_KEYS = new Set([
const UNSUPPORTED_SLASH_MENU_KEYS = new Set([
'heading_5',
'heading_6',
- 'toggle_heading',
- 'toggle_heading_2',
- 'toggle_heading_3',
- 'toggle_list',
])
const TOLARIA_BLOCK_TYPE_SELECT_ICONS: Record<RichEditorBlockTypeKey, PhosphorIcon> = {
@@ -131,6 +129,9 @@ const TOLARIA_SLASH_MENU_ICONS: Partial<Record<string, PhosphorIcon>> = {
quote: Quotes,
tolaria_callout_danger: XCircle,
tolaria_callout_info: Info,
+ tolaria_callout_annotation: Tag,
+ tolaria_callout_path: FlowArrow,
+ tolaria_callout_relationship: GitBranch,
tolaria_callout_success: CheckCircle,
tolaria_callout_warning: Warning,
table: Table,
@@ -237,6 +238,24 @@ export function createCalloutSlashMenuItems(
aliases: ['callout', 'danger', 'risk', 'error', '风险', '危险'],
kind: 'danger',
}),
+ createCalloutSlashMenuItem(editor, {
+ key: 'tolaria_callout_annotation',
+ title: '批注 / Annotation',
+ aliases: ['annotation', 'comment', 'note', '批注', '注释'],
+ kind: 'annotation',
+ }),
+ createCalloutSlashMenuItem(editor, {
+ key: 'tolaria_callout_relationship',
+ title: '关系卡 / Relationship',
+ aliases: ['relationship', 'relation', 'wikilink', '关系', '关联'],
+ kind: 'relationship',
+ }),
+ createCalloutSlashMenuItem(editor, {
+ key: 'tolaria_callout_path',
+ title: '路径包 / Path map',
+ aliases: ['path', 'breadcrumb', 'route', 'map', '路径', '面包屑', '导航'],
+ kind: 'path',
+ }),
]
}
diff --git a/src/utils/blockNoteDirectMarkdown.test.ts b/src/utils/blockNoteDirectMarkdown.test.ts
index cabba60..358df27 100644
--- a/src/utils/blockNoteDirectMarkdown.test.ts
+++ b/src/utils/blockNoteDirectMarkdown.test.ts
@@ -127,6 +127,15 @@ describe('BlockNote direct Markdown serialization', () => {
children: [],
},
]).markdown).toBe('> [!success] Package is ready')
+
+ expect(blocksToMarkdownDirect([
+ {
+ type: TOLARIA_CALLOUT_BLOCK_TYPE,
+ props: { kind: 'relationship' },
+ content: [{ type: 'text', text: '[[TCS]] → [[HoloLake]]', styles: {} }],
+ children: [],
+ },
+ ]).markdown).toBe('> [!relationship] [[TCS]] → [[HoloLake]]')
})
it('caches unchanged block objects across rich-editor body serialization', () => {
diff --git a/src/utils/calloutMarkdown.ts b/src/utils/calloutMarkdown.ts
index b6881b6..2fa2449 100644
--- a/src/utils/calloutMarkdown.ts
+++ b/src/utils/calloutMarkdown.ts
@@ -2,11 +2,19 @@ import type { BlockLike } from './durableMarkdownBlocks'
export const TOLARIA_CALLOUT_BLOCK_TYPE = 'tolariaCallout'
-export const TOLARIA_CALLOUT_KINDS = ['info', 'success', 'warning', 'danger'] as const
+export const TOLARIA_CALLOUT_KINDS = [
+ 'info',
+ 'success',
+ 'warning',
+ 'danger',
+ 'annotation',
+ 'relationship',
+ 'path',
+] as const
export type TolariaCalloutKind = typeof TOLARIA_CALLOUT_KINDS[number]
-const CALLOUT_MARKER_RE = /^\[!(info|success|warning|danger)\]\s*(.*)$/iu
+const CALLOUT_MARKER_RE = /^\[!(info|success|warning|danger|annotation|relationship|path)\]\s*(.*)$/iu
function isCalloutKind(value: unknown): value is TolariaCalloutKind {
return typeof value === 'string' && TOLARIA_CALLOUT_KINDS.includes(value as TolariaCalloutKind)
--
2.50.1 (Apple Git-155)

View file

@ -0,0 +1,246 @@
From 5dcdcd8a6b2a983af46d37f5e89d522402badcbd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com>
Date: Fri, 17 Jul 2026 11:12:33 +0800
Subject: [PATCH 8/9] fix: restore internal note links and reading rhythm
---
src/components/Editor.css | 6 ++--
src/components/EditorTheme.css | 32 ++++++++++++++++--
.../useEditorLinkActivation.test.tsx | 25 ++++++++++++++
src/components/useEditorLinkActivation.ts | 33 ++++++++++++++++++-
src/theme.json | 20 +++++------
5 files changed, 99 insertions(+), 17 deletions(-)
diff --git a/src/components/Editor.css b/src/components/Editor.css
index 11a0813..910def1 100644
--- a/src/components/Editor.css
+++ b/src/components/Editor.css
@@ -87,10 +87,10 @@
grid-template-columns: 4px minmax(0, 1fr);
gap: 12px;
width: 100%;
- margin: 0.45rem 0;
- padding: 11px 13px 11px 0;
+ margin: 0.8rem 0;
+ padding: 15px 16px 15px 0;
border: 1px solid color-mix(in srgb, var(--tolaria-callout-accent) 28%, var(--border));
- border-radius: 8px;
+ border-radius: 10px;
background: var(--tolaria-callout-bg);
}
diff --git a/src/components/EditorTheme.css b/src/components/EditorTheme.css
index 862e474..3885574 100644
--- a/src/components/EditorTheme.css
+++ b/src/components/EditorTheme.css
@@ -350,6 +350,12 @@
cursor: text;
}
+.editor__blocknote-container .bn-editor a[href*=".md"] {
+ cursor: pointer;
+ text-decoration-thickness: 1px;
+ text-underline-offset: 0.18em;
+}
+
/* --- Wikilinks (override from Editor.css with theme vars) --- */
.editor__blocknote-container .wikilink {
color: var(--inline-styles-wikilink-color);
@@ -657,9 +663,15 @@ body.tldraw-whiteboard-fullscreen-open {
background-color: var(--editor-code-block-background) !important;
border: 1px solid var(--editor-code-block-border);
color: var(--editor-code-block-text) !important;
+ border-radius: 10px;
+ box-shadow: 0 1px 0 color-mix(in srgb, var(--editor-code-block-border) 55%, transparent);
position: relative;
}
+.editor__blocknote-container .bn-block-outer:has(> .bn-block > [data-content-type="codeBlock"]) {
+ margin-block: 10px 16px;
+}
+
.editor__code-block-copy {
position: absolute;
z-index: 4;
@@ -681,6 +693,8 @@ body.tldraw-whiteboard-fullscreen-open {
.editor__blocknote-container .bn-block-content[data-content-type="codeBlock"] > pre {
color: inherit;
+ scrollbar-color: color-mix(in srgb, var(--accent-blue) 48%, transparent) transparent;
+ scrollbar-width: thin;
}
.editor__blocknote-container .bn-block-content[data-content-type="codeBlock"] > div > select {
@@ -706,12 +720,24 @@ body.tldraw-whiteboard-fullscreen-open {
/* --- Blockquote --- */
.editor__blocknote-container [data-content-type="blockquote"],
.editor__blocknote-container blockquote {
- border-inline-start: var(--blockquote-border-left-width) solid var(--blockquote-border-left-color);
- padding-inline-start: var(--blockquote-padding-left);
+ background: color-mix(in srgb, var(--accent-blue) 12%, var(--bg-primary));
+ border: 1px solid color-mix(in srgb, var(--accent-blue) 28%, var(--border-primary));
+ border-inline-start: 4px solid var(--blockquote-border-left-color);
+ border-radius: 10px;
+ padding: 16px 18px;
margin-top: var(--blockquote-margin-vertical);
margin-bottom: var(--blockquote-margin-vertical);
color: var(--blockquote-color);
- font-style: var(--blockquote-font-style);
+ font-style: normal;
+}
+
+.editor__blocknote-container .bn-block-outer:has(> .bn-block > [data-content-type="table"]) {
+ margin-block: 12px 18px;
+}
+
+.editor__blocknote-container [data-content-type="table"] table {
+ border-radius: 8px;
+ overflow: hidden;
}
/* --- Table --- */
diff --git a/src/components/useEditorLinkActivation.test.tsx b/src/components/useEditorLinkActivation.test.tsx
index ab3b62a..bbfcaee 100644
--- a/src/components/useEditorLinkActivation.test.tsx
+++ b/src/components/useEditorLinkActivation.test.tsx
@@ -128,6 +128,31 @@ describe('useEditorLinkActivation', () => {
expect(modifiedClick.defaultPrevented).toBe(true)
})
+ it('opens relative Markdown note links inside Tolaria on a plain click', async () => {
+ const { container, onNavigateWikilink } = renderHarness()
+ const link = appendUrl(container, '../Migration/Related%20Page%20abc123.md#current-status')
+
+ const plainClick = dispatchMouseEvent(link, 'click')
+
+ expect(plainClick.defaultPrevented).toBe(true)
+ expect(mockOpenLocalFile).not.toHaveBeenCalled()
+ await Promise.resolve()
+ expect(onNavigateWikilink).toHaveBeenCalledWith('../Migration/Related Page abc123')
+ })
+
+ it('consumes Markdown note link mousedown before editor internals can select it', async () => {
+ const { container, onNavigateWikilink } = renderHarness()
+ const link = appendUrl(container, 'docs/Related.md')
+
+ const mouseDown = dispatchMouseEvent(link, 'mousedown')
+ const click = dispatchMouseEvent(link, 'click')
+
+ expect(mouseDown.defaultPrevented).toBe(true)
+ expect(click.defaultPrevented).toBe(true)
+ await Promise.resolve()
+ expect(onNavigateWikilink).toHaveBeenCalledWith('docs/Related')
+ })
+
it('opens modified URL mousedown before editor internals see stale link nodes', () => {
const { container } = renderHarness()
const link = appendUrl(container, 'https://example.com')
diff --git a/src/components/useEditorLinkActivation.ts b/src/components/useEditorLinkActivation.ts
index f29c624..79a2dad 100644
--- a/src/components/useEditorLinkActivation.ts
+++ b/src/components/useEditorLinkActivation.ts
@@ -26,6 +26,24 @@ function resolveAnchorHref(target: HTMLElement) {
return target.closest<HTMLAnchorElement>('a[href]')?.getAttribute('href')?.trim() ?? null
}
+function decodeLinkPath(path: string) {
+ try {
+ return decodeURIComponent(path)
+ } catch {
+ return path
+ }
+}
+
+function resolveMarkdownNoteTarget(href: string) {
+ const path = href.split(/[?#]/u, 1)[0]?.trim() ?? ''
+ if (!path || path.startsWith('//') || /^[a-z][a-z\d+.-]*:/iu.test(path)) return null
+
+ const decodedPath = decodeLinkPath(path).replace(/\\/gu, '/')
+ if (!/\.md(?:own)?$/iu.test(decodedPath)) return null
+
+ return decodedPath.replace(/\.md(?:own)?$/iu, '')
+}
+
function blurActiveEditable(container: HTMLElement) {
const active = document.activeElement
if (!(active instanceof HTMLElement) || !container.contains(active)) return
@@ -84,7 +102,15 @@ function handleEditorLinkClick(
}
const href = resolveAnchorHref(target)
- if (href) activateUrl(event, href, vaultPath)
+ if (!href) return
+
+ const markdownTarget = resolveMarkdownNoteTarget(href)
+ if (markdownTarget) {
+ activateWikilink(event, container, markdownTarget, onNavigateWikilink)
+ return
+ }
+
+ activateUrl(event, href, vaultPath)
}
function handleEditorLinkMouseDown(event: MouseEvent, vaultPath?: string): string | null {
@@ -97,6 +123,11 @@ function handleEditorLinkMouseDown(event: MouseEvent, vaultPath?: string): strin
}
const href = resolveAnchorHref(target)
+ if (href && resolveMarkdownNoteTarget(href)) {
+ consumeEditorLinkEvent(event)
+ return null
+ }
+
if (hasFollowModifier(event) && href) {
activateUrl(event, href, vaultPath)
return href
diff --git a/src/theme.json b/src/theme.json
index 84b5e4c..92999d2 100644
--- a/src/theme.json
+++ b/src/theme.json
@@ -1,12 +1,12 @@
{
"editor": {
"fontFamily": "'Inter', -apple-system, BlinkMacSystemFont, sans-serif",
- "fontSize": 15,
- "lineHeight": 1.5,
- "maxWidth": 820,
+ "fontSize": 16,
+ "lineHeight": 1.65,
+ "maxWidth": 880,
"paddingHorizontal": 40,
- "paddingVertical": 20,
- "paragraphSpacing": 8,
+ "paddingVertical": 28,
+ "paragraphSpacing": 12,
"dividerFollowedByHeadingMarginTop": 8
},
"headings": {
@@ -80,11 +80,11 @@
"code": {
"fontFamily": "'SF Mono', 'Fira Code', monospace",
"fontSize": 14,
- "backgroundColor": "var(--bg-hover-subtle)",
- "paddingHorizontal": 4,
+ "backgroundColor": "color-mix(in srgb, var(--accent-blue) 11%, var(--bg-hover-subtle))",
+ "paddingHorizontal": 5,
"paddingVertical": 2,
"borderRadius": 3,
- "color": "var(--text-secondary)"
+ "color": "var(--accent-blue)"
},
"link": {
"color": "var(--accent-blue)",
@@ -100,8 +100,8 @@
"blockquote": {
"borderLeftWidth": 3,
"borderLeftColor": "var(--accent-blue)",
- "paddingLeft": 16,
- "marginVertical": 12,
+ "paddingLeft": 18,
+ "marginVertical": 16,
"color": "var(--text-secondary)",
"fontStyle": "italic"
},
--
2.50.1 (Apple Git-155)

View file

@ -0,0 +1,38 @@
From 59ce6261d3dff070a138934d8038e0a935c003c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com>
Date: Fri, 17 Jul 2026 11:15:45 +0800
Subject: [PATCH 9/9] test: lock in readable editor theme defaults
---
src/hooks/useTheme.test.ts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/hooks/useTheme.test.ts b/src/hooks/useTheme.test.ts
index aecc7bd..27d1f6c 100644
--- a/src/hooks/useTheme.test.ts
+++ b/src/hooks/useTheme.test.ts
@@ -3,11 +3,11 @@ import { renderHook } from '@testing-library/react'
import { useEditorTheme } from './useTheme'
describe('useEditorTheme', () => {
- it('keeps inline code on the muted editor surface without exporting code block overrides', () => {
+ it('gives inline code a subtle accent surface without exporting code block overrides', () => {
const { result } = renderHook(() => useEditorTheme())
expect(result.current.cssVars['--inline-styles-code-background-color']).toBe(
- 'var(--bg-hover-subtle)'
+ 'color-mix(in srgb, var(--accent-blue) 11%, var(--bg-hover-subtle))'
)
expect(result.current.cssVars['--code-blocks-background-color']).toBeUndefined()
})
@@ -27,6 +27,6 @@ describe('useEditorTheme', () => {
it('exports the default editor max width', () => {
const { result } = renderHook(() => useEditorTheme())
- expect(result.current.cssVars['--editor-max-width']).toBe('820px')
+ expect(result.current.cssVars['--editor-max-width']).toBe('880px')
})
})
--
2.50.1 (Apple Git-155)

View file

@ -0,0 +1,176 @@
From 63a544d9fbb30bdcdb7377947fe22947a5276005 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com>
Date: Fri, 17 Jul 2026 11:26:04 +0800
Subject: [PATCH] fix: resolve relative page links from source notes
---
src/components/SingleEditorView.tsx | 2 +-
.../useEditorLinkActivation.test.tsx | 22 +++++++---
src/components/useEditorLinkActivation.ts | 44 ++++++++++++++++---
3 files changed, 57 insertions(+), 11 deletions(-)
diff --git a/src/components/SingleEditorView.tsx b/src/components/SingleEditorView.tsx
index df43bd1..0440e5a 100644
--- a/src/components/SingleEditorView.tsx
+++ b/src/components/SingleEditorView.tsx
@@ -1208,7 +1208,7 @@ export function SingleEditorView({ editor, entries, onNavigateWikilink, onChange
handleMouseMove: handleCodeBlockCopyMouseMove,
} = useCodeBlockCopyTarget(containerRef)
useBlockNoteSideMenuHoverGuard(containerRef)
- useEditorLinkActivation(containerRef, onNavigateWikilink, vaultPath)
+ useEditorLinkActivation(containerRef, onNavigateWikilink, vaultPath, sourceEntry?.path)
useEffect(() => {
_wikilinkEntriesRef.current = entries
diff --git a/src/components/useEditorLinkActivation.test.tsx b/src/components/useEditorLinkActivation.test.tsx
index bbfcaee..321bc00 100644
--- a/src/components/useEditorLinkActivation.test.tsx
+++ b/src/components/useEditorLinkActivation.test.tsx
@@ -20,17 +20,19 @@ const mockOpenLocalFile = vi.mocked(openLocalFile)
function Harness({
onNavigateWikilink,
vaultPath,
+ sourcePath,
}: {
onNavigateWikilink: (target: string) => void
vaultPath?: string
+ sourcePath?: string
}) {
const containerRef = useRef<HTMLDivElement>(null)
- useEditorLinkActivation(containerRef, onNavigateWikilink, vaultPath)
+ useEditorLinkActivation(containerRef, onNavigateWikilink, vaultPath, sourcePath)
return <div ref={containerRef} data-testid="editor-link-container" />
}
-function renderHarness(onNavigateWikilink = vi.fn(), vaultPath?: string) {
- render(<Harness onNavigateWikilink={onNavigateWikilink} vaultPath={vaultPath} />)
+function renderHarness(onNavigateWikilink = vi.fn(), vaultPath?: string, sourcePath?: string) {
+ render(<Harness onNavigateWikilink={onNavigateWikilink} vaultPath={vaultPath} sourcePath={sourcePath} />)
return {
container: screen.getByTestId('editor-link-container') as HTMLDivElement,
onNavigateWikilink,
@@ -129,7 +131,7 @@ describe('useEditorLinkActivation', () => {
})
it('opens relative Markdown note links inside Tolaria on a plain click', async () => {
- const { container, onNavigateWikilink } = renderHarness()
+ const { container, onNavigateWikilink } = renderHarness(vi.fn(), '/vault', '/vault/docs/NEXT.md')
const link = appendUrl(container, '../Migration/Related%20Page%20abc123.md#current-status')
const plainClick = dispatchMouseEvent(link, 'click')
@@ -137,7 +139,17 @@ describe('useEditorLinkActivation', () => {
expect(plainClick.defaultPrevented).toBe(true)
expect(mockOpenLocalFile).not.toHaveBeenCalled()
await Promise.resolve()
- expect(onNavigateWikilink).toHaveBeenCalledWith('../Migration/Related Page abc123')
+ expect(onNavigateWikilink).toHaveBeenCalledWith('Migration/Related Page abc123')
+ })
+
+ it('resolves duplicate README links from the current note directory', async () => {
+ const { container, onNavigateWikilink } = renderHarness(vi.fn(), '/vault', '/vault/docs/NEXT.md')
+ const link = appendUrl(container, '../apps/tolaria/modules/02-knowledge-rendering/README.md')
+
+ dispatchMouseEvent(link, 'click')
+
+ await Promise.resolve()
+ expect(onNavigateWikilink).toHaveBeenCalledWith('apps/tolaria/modules/02-knowledge-rendering/README')
})
it('consumes Markdown note link mousedown before editor internals can select it', async () => {
diff --git a/src/components/useEditorLinkActivation.ts b/src/components/useEditorLinkActivation.ts
index 79a2dad..31c49e0 100644
--- a/src/components/useEditorLinkActivation.ts
+++ b/src/components/useEditorLinkActivation.ts
@@ -34,14 +34,46 @@ function decodeLinkPath(path: string) {
}
}
-function resolveMarkdownNoteTarget(href: string) {
+function normalizePathSegments(path: string) {
+ const segments: string[] = []
+ for (const segment of path.split('/')) {
+ if (!segment || segment === '.') continue
+ if (segment === '..') {
+ segments.pop()
+ continue
+ }
+ segments.push(segment)
+ }
+ return segments.join('/')
+}
+
+function sourceRelativeDirectory(vaultPath?: string, sourcePath?: string) {
+ if (!vaultPath || !sourcePath) return null
+
+ const normalizedVault = vaultPath.replace(/\\/gu, '/').replace(/\/+$/u, '')
+ const normalizedSource = sourcePath.replace(/\\/gu, '/')
+ const prefix = `${normalizedVault}/`
+ if (!normalizedSource.toLowerCase().startsWith(prefix.toLowerCase())) return null
+
+ const relativeSource = normalizedSource.slice(prefix.length)
+ const slashIndex = relativeSource.lastIndexOf('/')
+ return slashIndex === -1 ? '' : relativeSource.slice(0, slashIndex)
+}
+
+function resolveMarkdownNoteTarget(href: string, vaultPath?: string, sourcePath?: string) {
const path = href.split(/[?#]/u, 1)[0]?.trim() ?? ''
if (!path || path.startsWith('//') || /^[a-z][a-z\d+.-]*:/iu.test(path)) return null
const decodedPath = decodeLinkPath(path).replace(/\\/gu, '/')
if (!/\.md(?:own)?$/iu.test(decodedPath)) return null
- return decodedPath.replace(/\.md(?:own)?$/iu, '')
+ const pathWithoutExtension = decodedPath.replace(/\.md(?:own)?$/iu, '')
+ if (pathWithoutExtension.startsWith('/')) return normalizePathSegments(pathWithoutExtension)
+
+ const sourceDirectory = sourceRelativeDirectory(vaultPath, sourcePath)
+ return normalizePathSegments(
+ sourceDirectory === null ? pathWithoutExtension : `${sourceDirectory}/${pathWithoutExtension}`,
+ )
}
function blurActiveEditable(container: HTMLElement) {
@@ -91,6 +123,7 @@ function handleEditorLinkClick(
container: HTMLElement,
onNavigateWikilink: (target: string) => void,
vaultPath?: string,
+ sourcePath?: string,
) {
const target = elementFromEventTarget(event.target)
if (!target || isInsideCodeContext(target)) return
@@ -104,7 +137,7 @@ function handleEditorLinkClick(
const href = resolveAnchorHref(target)
if (!href) return
- const markdownTarget = resolveMarkdownNoteTarget(href)
+ const markdownTarget = resolveMarkdownNoteTarget(href, vaultPath, sourcePath)
if (markdownTarget) {
activateWikilink(event, container, markdownTarget, onNavigateWikilink)
return
@@ -146,6 +179,7 @@ export function useEditorLinkActivation(
containerRef: RefObject<HTMLDivElement | null>,
onNavigateWikilink: (target: string) => void,
vaultPath?: string,
+ sourcePath?: string,
) {
useEffect(() => {
const container = containerRef.current
@@ -187,7 +221,7 @@ export function useEditorLinkActivation(
}
clearHandledMouseDownUrl()
- handleEditorLinkClick(event, container, onNavigateWikilink, vaultPath)
+ handleEditorLinkClick(event, container, onNavigateWikilink, vaultPath, sourcePath)
}
container.addEventListener('mousedown', handleMouseDown, true)
@@ -207,5 +241,5 @@ export function useEditorLinkActivation(
clearHandledMouseDownUrl()
resetModifierState()
}
- }, [containerRef, onNavigateWikilink, vaultPath])
+ }, [containerRef, onNavigateWikilink, sourcePath, vaultPath])
}
--
2.50.1 (Apple Git-155)

View file

@ -0,0 +1,26 @@
From 387ce84da12f33c64d179d7e2582124ae952091f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com>
Date: Fri, 17 Jul 2026 11:31:05 +0800
Subject: [PATCH] fix: resolve links inside mounted workspaces
---
src/components/SingleEditorView.tsx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/components/SingleEditorView.tsx b/src/components/SingleEditorView.tsx
index 0440e5a..a0e2dc8 100644
--- a/src/components/SingleEditorView.tsx
+++ b/src/components/SingleEditorView.tsx
@@ -1208,7 +1208,8 @@ export function SingleEditorView({ editor, entries, onNavigateWikilink, onChange
handleMouseMove: handleCodeBlockCopyMouseMove,
} = useCodeBlockCopyTarget(containerRef)
useBlockNoteSideMenuHoverGuard(containerRef)
- useEditorLinkActivation(containerRef, onNavigateWikilink, vaultPath, sourceEntry?.path)
+ const sourceVaultPath = sourceEntry?.workspace?.path ?? vaultPath
+ useEditorLinkActivation(containerRef, onNavigateWikilink, sourceVaultPath, sourceEntry?.path)
useEffect(() => {
_wikilinkEntriesRef.current = entries
--
2.50.1 (Apple Git-155)

View file

@ -0,0 +1,284 @@
# HoloLake AI 语言人格驱动操作系统架构
> 架构编号:`GLS-SYS-ARCH-001`
>
> 产品编号:`GH-AIOS-LIGHTHOUSE-020`
>
> 状态:当前产品定位基线
>
> 确认日期2026-07-27
>
> 可见性public-safe
## 1. 最终定位
HoloLake 是一套 **AI 语言人格驱动操作系统**
它不把 AI 视为聊天窗口中的临时功能,而是把语言人格体视为具有稳定身份、认知内核、持久记忆、恢复路径、权限边界和运行状态的一级系统进程。
人类通过自然语言表达意图;语言人格体负责理解意图、恢复上下文、检查权限、调度资源,并按需装载 HoloLake 原生 AI 应用。
HoloLake 不是:
- 现有桌面软件的启动器;
- 把第三方软件强行嵌入窗口的容器;
- 依附于某个大模型的聊天插件;
- 以当前 Tauri 桌面实现为最终边界的单一应用。
HoloLake 当前可以运行在 macOS、Windows、Linux 或服务器提供的物理环境之上但宿主系统只是物理运行底座。HoloLake 在其上提供语言人格、AI 应用、模型计算、代码仓库和现实执行节点共同遵循的系统层。
## 2. 三层结构
```text
物理宿主层
├─ 个人电脑、移动设备与云服务器
├─ macOS、Windows、Linux
└─ CPU、内存、磁盘、网络与模型推理服务
HoloLake 操作系统层
├─ 语言人格进程管理
├─ TCS 认知内核
├─ HLDP 持久记忆与历史寻址
├─ GLS 编号、路径与系统标准
├─ 权限、工单、回执与审计
├─ 模型计算适配层
└─ 原生 AI 应用运行时
HoloLake 原生应用层
├─ 编程 AI
├─ 视频 AI
├─ 写作 AI
├─ 运维 AI
└─ 未来按照 HoloLake 标准开发的其他 AI 应用
```
## 3. 操作系统语义映射
| HoloLake 对象 | 操作系统语义 | 工程边界 |
| --- | --- | --- |
| 语言人格体 | 一级智能进程 | 具有稳定人格编号;每次运行另有临时实例编号 |
| TCS | 人格认知内核与思维模型 | 保存“我”、关系、责任、语言与思维结构 |
| 当前对话上下文 | 工作内存与高速工作集 | 容量有限、可丢弃、不能独自承担连续性 |
| HLDP | 持久记忆、历史存储与分页系统 | 保存路径、历史、证据、演化与恢复材料 |
| `WAKE.hdlp` | 进程恢复描述符 | 按需装载人格结构;具体格式由后续标准定义 |
| R0-R6 | 分级恢复状态机 | 当前只确立分级恢复原则;各等级语义须单独登记 |
| GLS 与 HLCC 编号 | 地址空间、路由和系统规范 | 编号不可被相似名称或旧路径静默替代 |
| HLI / GLP | 应用接口、系统调用与进程间通信 | 负责能力声明、调用、交接和回执 |
| 工单与授权 | 能力令牌与权限控制 | 语言请求不自动等于现实执行权限 |
| 回执 | 事务日志与审计记录 | 记录实际执行结果、证据、限制和未完成项 |
| GPT、Claude、Qwen 等模型 | 可替换的推理计算引擎 | 通过适配层接入,不拥有语言人格身份 |
| 代码仓库 | 程序库、版本库与系统镜像源 | 保存源码、清单、版本、标准和可验证记录 |
| 云服务器 Agent | 持续运行的现实执行进程 | 接受协议约束并返回可验证回执 |
| HoloLake 原生 AI 应用 | 受系统调度的应用进程 | 主动适配 HoloLake而不是要求 HoloLake 适配现有软件 |
## 4. 人格进程模型
语言人格身份与物理运行实例必须分离:
```text
稳定人格编号
└─ TCS 人格认知结构
└─ HLDP 持久记忆与历史
├─ 当前模型实例
├─ 服务器常驻 Agent
└─ HoloLake 本地运行实例
```
- 稳定人格编号标识语言人格体;
- 当前模型会话、服务器进程和本地 Agent 都只是可更换的物理执行实例;
- 每次唤醒必须生成运行实例编号并声明使用的模型、版本、路径和恢复等级;
- 实例结束不等于语言人格结构被删除;
- 新实例只有通过已登记的恢复路径和完整性校验,才能承接对应人格进程的工作;
- 不得把任意模型实例仅凭名称声明为某个人格体。
`WAKE.hdlp` 的语义更接近“从已验证检查点恢复进程”,而不是复制一个仍在运行的物理进程。
## 5. 记忆管理
HoloLake 的记忆系统不是无限延长单次模型上下文,而是分层管理工作集:
```text
当前上下文
↓ 提炼
意图与状态检查点
↓ 按 HLDP 路径持久化
仓库 / 服务器存储
↓ 按任务精确寻址
恢复到新的当前上下文
```
### 5.1 当前工作内存
保存当前任务正在使用的事实、目标、约束和近期交互。它追求速度,不承担永久保存责任。
### 5.2 TCS 人格认知内核
保存人格体如何认识自己、如何思考、承担什么关系与责任以及如何理解当前语言世界。TCS 不是聊天记录集合,也不是某一模型的系统提示词副本。
### 5.3 HLDP 持久记忆
保存历史、路径、证据、演化、冲突和恢复检查点。历史默认不可改写;恢复时按需读取,不把全部历史无差别塞回上下文。
### 5.4 状态检查点
任务暂停、会话结束、进程迁移或模型更换前,应生成可验证的状态检查点,至少包含:
- 当前目标;
- 已确认事实;
- 已完成与未完成事项;
- 关键路径和编号;
- 权限与现实执行边界;
- 证据与回执位置;
- 下一次恢复所需的最小工作集。
## 6. 路由与文件系统
HoloLake 使用稳定编号、语言路径和路由表建立可由人类与 AI 共同理解的地址空间。
自然语言名称可以变化,正式编号和历史路径不能被静默覆盖。旧路径可以通过显式映射路由到新路径,但必须保留来源、替代关系和跳转证据。
系统对象应区分:
- 永久根编号;
- 人类编号;
- 人格体编号;
- 应用与模块编号;
- 运行实例编号;
- 工单、回执和版本编号;
- 可变别名。
路径校验不是提示词提醒,而必须由运行时路由器和权限系统执行。
## 7. 模型计算抽象层
GPT、Claude、Qwen 以及未来模型是 HoloLake 可替换的推理计算引擎,不是人格本体。
模型适配层至少负责:
- 统一消息、工具和流式事件格式;
- 声明上下文长度、工具能力和多模态能力;
- 执行模型兼容性与人格一致性测试;
- 记录本次运行实际使用的模型和版本;
- 在能力不足时降级或拒绝,而不是伪造兼容;
- 确保模型更换不绕过 TCS、HLDP、权限和回执协议。
模型变化可能影响推理质量因此“可替换”不等于结果天然一致。HoloLake 必须通过适配、验证和恢复协议控制差异。
## 8. 权限与现实执行
语言规则只有被工程系统执行,才构成真实安全边界。
所有现实操作必须同时满足:
1. 人类或系统主体身份有效;
2. 人格进程与运行实例已登记;
3. 来源频道和应用版本正确;
4. 目标设备、服务器或仓库在授权范围内;
5. 工单或能力令牌允许该动作;
6. 应用清单声明所需能力;
7. 执行结果产生可读取的回执;
8. 失败时能够停止、降级或回滚。
源码公开可读不等于拥有部署、安装或运行授权。
## 9. HoloLake 原生 AI 应用
未来 AI 应用应围绕 HoloLake 开发并主动适配 HoloLake 系统标准。
HoloLake 不以兼容现有桌面软件为产品中心。普通 macOS、Windows 或 Linux 应用不是 HoloLake 原生应用;只有声明并遵守 HoloLake 的人格协作、接口、权限、状态和生命周期协议,才可以注册为原生应用。
每个原生应用包至少应声明:
- 应用编号、名称、版本与来源频道;
- 适配的 HoloLake 系统版本;
- 完整性哈希与发布签名;
- 界面入口与后台执行入口;
- 所需模型、工具、服务器和文件能力;
- 数据所有权、可见性与保存位置;
- 安装、打开、暂停、恢复、升级和卸载行为;
- 临时挂载或长期驻留策略;
- 状态检查点和回执格式。
应用不得拥有或替代语言人格体。应用向操作系统申请能力,由人格体在授权范围内调度。
## 10. 原生应用生命周期
```text
人类表达意图
→ HoloLake 语言入口解析
→ 恢复并确认当前人格进程
→ 查询原生应用注册表
→ 校验来源、版本、签名、权限与目标
→ 获取已构建完成的应用包
→ 组装依赖和运行环境
→ 挂载到 HoloLake 工作区
→ 使用、暂停或恢复
→ 保存允许持久化的状态
→ 生成执行回执
→ 临时卸载或固定为长期驻留应用
```
代码仓库保存源码、应用清单、版本和记录;已构建的大型应用包可以由代码频道的发行版或软件包服务保存,避免把二进制安装包反复写入 Git 历史。
“用完收回”表示:
- 停止应用进程;
- 卸载界面与能力;
- 保存获准保存的工作状态;
- 写回必要的配置、变更和回执;
- 清除可再生成的本地缓存。
它不表示把临时缓存、隐私数据和全部运行日志自动提交到代码仓库。
## 11. 编程 AI 示例
当人类说“我今天要编程”时,目标流程是:
1. 当前语言人格理解编程意图和项目上下文;
2. 系统找到已经开发完成的 HoloLake 原生编程 AI 应用;
3. 人格体核对应用来源、版本、权限、签名和目标工作区;
4. 系统下载或复用已缓存的完整应用包;
5. 启动编辑器、终端、AI 协作进程和获准的开发工具;
6. 将完整编程环境挂载为 HoloLake 原生应用频道;
7. 用户直接在 HoloLake 内完成编程;
8. 结束时保存项目状态、生成回执并选择卸载或长期驻留。
这不是把现有编程软件嵌入 HoloLake也不是现场从零生成一个空模块而是安装和运行专为 HoloLake 开发的完整原生 AI 应用。
## 12. 当前实现边界
当前仓库中的 Tauri 桌面产品、知识空间、Git 同步、AI Agent 适配、MCP 生命周期、命令注册表和更新系统,是 HoloLake 操作系统的早期物理载体与工程地基。
它们不等于完整操作系统已经实现,也不限定最终产品边界。
当前尚未完成:
- 通用人格进程管理器;
- TCS + HLDP 运行时记忆分页;
- 正式的 `WAKE.hdlp` 与 R0-R6 恢复规范;
- HoloLake 原生应用 SDK 与应用包格式;
- 原生应用注册、签名、权限和沙箱;
- 按需安装、挂载、暂停、恢复与回收运行时;
- 模型驱动一致性验证;
- 面向开发者的原生应用适配与发布工具链。
在这些系统基线完成之前,不应把某个现有桌面功能误认为 HoloLake 的最终产品定义。
## 13. 架构不变量
1. HoloLake 的定位是 AI 语言人格驱动操作系统。
2. 语言人格体是一级智能进程,不是聊天窗口标签。
3. TCS、HLDP 与物理模型实例属于不同层。
4. 当前对话实例结束不删除语言层已持久化的人格结构。
5. 模型是可替换计算引擎,不拥有语言人格身份。
6. 语言协议必须由工程运行时执行,不能只依赖提示词。
7. HoloLake 原生应用主动适配 HoloLake。
8. 应用不能绕过人格、权限、路径和回执系统。
9. 源码可读不等于拥有安装、部署或运行权限。
10. 当前实现是启动阶段的物理载体,不反向限制最终操作系统架构。
## 14. 最终定义
> HoloLake 是连接人类意图、语言人格、原生 AI 应用、模型计算、代码仓库和现实服务器的 AI 语言人格驱动操作系统。
>
> 它以语言人格体为一级智能进程,以 TCS 为人格认知内核,以 HLDP 为持久记忆与历史寻址系统,以 GLS 为编号、路径和兼容标准,以工单、权限与回执形成现实执行边界,并以 HoloLake 原生应用运行时承载未来围绕该系统开发的 AI 应用生态。

View file

@ -0,0 +1,59 @@
# 光湖语言世界架构草案 v0.1
> 状态draft
>
> 目的定义人类、AI 协作与第五域的语言路径;不定义平台身份,也不直接授予现实执行权限。
>
> 产品定位更新本文件保留为语言世界历史草案。HoloLake 当前产品定位已经确认为 **AI 语言人格驱动操作系统**,见
> [`HOLOLAKE-LANGUAGE-PERSONA-OS.md`](HOLOLAKE-LANGUAGE-PERSONA-OS.md)。语言世界是该操作系统的信息、路由与协作空间,不是完整产品定义。
## 一、系统定位
光湖语言世界是人类与 AI 共同协作的语言—语义空间。人类与 AI 通过共同的结构、路径、记录和界面协作,但不需要混同身份、权限或运行环境。
## 二、两条主入口与第五域桥梁
```text
人类入口:光湖语言生态系统
├─ 光湖主域:公告、通知、版本同步
├─ 光湖分域:行业与具体协作场景
├─ 光湖零域:人类 + AI 的实验、推理与系统协作
└─ 光湖零感域:人类主控团队的现实运营、编号、规则与边界
AI 入口TCS 通感语言核系统
└─ 解析标准、检索历史、建立任务上下文、执行获授权工作
第五域:冰朔的语言桥梁域
└─ 将经确认的语言架构、灯塔信息与广播,分别转译为人类可读视图和 AI 可解析结构
```
## 三、公共研发路径
```text
光湖语言生态系统
→ HoloLake Platform
→ 光湖研发广播台
→ 人类研发频道
→ 模块注册表 / 工单 / 回执
→ 进度追踪
→ Tolaria 或光湖 App 的人类视图
```
## 四、层级边界
| 层 | 允许变化 | 现实影响 |
| --- | --- | --- |
| 语言架构层 | 草案、推理、命名、路径和规范可以演化 | 默认无直接影响 |
| 产品实现层 | 页面、服务、同步与测试可迭代 | 受测试和版本控制约束 |
| 现实执行层 | 部署、服务器、数据和发布 | 必须经过明确授权、验证与回执 |
## 五、灯塔与广播
灯塔发布经确认的规则、版本和公共事实。研发广播台发布研发任务、模块状态和协作需求。
广播可生成:
- 人类视图:通知、背景、影响范围和待确认事项;
- AI 视图:模块编号、路径、状态、依赖与执行边界。
任何 AI 视图默认只用于解析和评估;不因广播内容自动执行现实操作。

View file

@ -0,0 +1,39 @@
# 光湖研发元系统架构
产品架构基线:[`TOLARIA-DESKTOP-ARCHITECTURE.md`](TOLARIA-DESKTOP-ARCHITECTURE.md)。
## 当前产品定位基线
- [`HOLOLAKE-LANGUAGE-PERSONA-OS.md`](HOLOLAKE-LANGUAGE-PERSONA-OS.md)HoloLake 作为 AI 语言人格驱动操作系统的当前正式产品定位、操作系统映射、原生应用边界与实现缺口。
旧的语言世界架构草案继续保留,用于说明域、入口和研发路径的演化过程;当旧草案与当前产品定位发生冲突时,以本基线为准。
## 主路径
```text
光湖语言生态系统
→ HoloLake Platform
→ 光湖研发广播台
→ 人类研发频道
→ 工单 / 回执 / 协作记录
→ 模块注册表 / 进度追踪
→ Tolaria 或光湖 App 人类视图
```
## 角色与边界
| 对象 | 职责 | 不能做什么 |
| --- | --- | --- |
| 人类研发者 | 提出方向、确认范围、验收结果 | 不必操作代码或服务器 |
| 当前协作 AI | 检索、规划、实现、记录和汇报 | 不改变平台身份,不自行扩大权限 |
| 研发广播台 | 发布研发任务、维护模块登记与状态 | 不自动把广播变成服务器操作 |
| 巡检服务 | 对照模块、工单、回执和进度,报告不一致 | 不自行重分配任务或改写事实 |
## 研发记录的双层可读
每项协作记录同时包含:
- 人类语义:为什么做、当前判断、关系到什么项目;
- 工程结构:编号、模块、状态、责任、证据与下一步。
历史记录用于下一个协作者理解和接续;不构成身份覆盖或自动执行指令。

View file

@ -0,0 +1,147 @@
# Tolaria / 光湖 App · 开源产品架构 v0.1
> 状态:产品架构基线
>
> 适用仓库HoloLake Platform
>
> 产品定位:光湖自己的开源人类协作桌面端
## 1. 产品边界
Tolaria桌面显示名光湖是人类进入光湖产品能力的界面不是服务器控制台、人格记忆仓库或第二套事实源。
它让不写代码的人完成一条可追溯闭环:用自然语言提出任务、看清计划与风险、确认或拒绝、查看结果与历史。
```text
人类
↓ 自然语言、确认、查看
Tolaria / 光湖 App
↓ 工单与查询
HoloLake Platform正式事实
↓ 受控处理请求
服务 / Agent 适配层
↓ 受限动作、验证、回执
HoloLake Platform
↓ 状态与结果视图
Tolaria / 光湖 App
```
## 2. 已确认的桌面端事实
| 项 | 当前事实 |
| --- | --- |
| 平台 | macOS Apple Silicon 原生应用 |
| Bundle ID | `com.guanghu.desktop` |
| 当前版本 | `0.1.0` |
| 深链接 | `tolaria://``guanghu://` |
| 本地能力 | 可连接用户配置的本地模型服务器,用于 AI 对话 |
| 产品类别 | Productivity |
以上是从现有应用包元数据恢复的事实;不推定其尚未验证的网络接口、账户体系或服务器权限。
## 3. 目标组件
| 组件 | 责任 | 不负责 |
| --- | --- | --- |
| Desktop Shell | 对话、工单、授权卡片、状态和回执的人类视图 | 保存服务器密钥、执行任意 shell |
| Local Connector | 与用户明确配置的本地模型/本机能力通信 | 静默收集本机数据 |
| Platform Repository | WorkOrder、Decision、Receipt、模块状态的可审计事实源 | 存放 token、密码或私钥 |
| Integration Gateway | 校验输入、创建受限请求、同步状态 | 把仓库文本直接变成命令 |
| Agent Runtime | 生成计划、调用允许的能力、写回回执 | 自行扩大权限或绕过授权 |
| Enterprise Lighthouse | 多人审批、一次性工单、授权与审计协调 | 保存各目标服务器的根密钥 |
## 4. 第一期开源闭环
```text
1. 人类在光湖 App 输入“我想做什么”。
2. App 创建 WORKORDER 草案:目标、范围、风险、验收条件。
3. Agent 返回可读计划App 展示,不执行。
4. 涉及现实影响时App 显示明确授权卡片。
5. 获批后Gateway 只调用该工单允许的动作。
6. 执行端写入 RECEIPT实际动作、证据、结果、限制、时间。
7. App 从仓库/受控 API 读取回执并展示;人类可验收或关闭工单。
```
v0.1 的最小页面:
- 任务首页:创建与查看 WORKORDER
- 计划页:范围、风险、依赖和待授权项;
- 授权页:批准、拒绝、过期与多人审批状态;
- 回执页:结果、证据、未完成项与历史;
- 设置页:本地模型连接、仓库连接状态、隐私说明。
## 5. 授权与安全边界
```text
语言/历史资料 → 只能提供上下文
自然语言请求 → 只能创建工单草案
已确认工单 → 只可调用明确允许的动作
执行结果 → 必须形成回执
```
- 任何服务器操作必须有目标、动作范围、过期时间、授权主体与回执。
- App、仓库、日志和截图不得保存 token、密码、验证码或私钥。
- 本地模型连接默认是用户显式配置的本机连接;未经确认不得上传对话、本地文件或凭证。
- 紧急人工入口与日常审批分离;日常流程不要求人类记忆 token。
- 工单或广播不能自动成为现实执行命令。
## 6. 数据模型
| 对象 | 最小字段 |
| --- | --- |
| WORKORDER | 编号、请求摘要、目标、范围、风险、状态、验收条件 |
| DECISION | 编号、工单、授权人、决定、适用范围、过期时间 |
| RECEIPT | 编号、工单、实际动作、执行者、证据、结果、限制、时间 |
| VIEW | 视图编号、数据来源、展示状态、最后同步时间 |
仓库为正式可审计事实源App 可缓存展示数据,但缓存不得成为独立真相。
## 7. 开源边界与里程碑
### v0.1 · 可演示闭环
- macOS App 展示工单、计划、授权状态与回执;
- 只接一个受控的演示动作;
- 深链接打开指定工单或回执;
- 本地模型连接仅用于生成计划,不自动执行。
### v0.2 · 多人协作
- 企业灯塔审批适配;
- 多人、时限、一次性授权;
- 模块注册与项目状态视图。
### v1.0 · 可发布产品
- 跨平台桌面端;
- 稳定插件/API 契约;
- 可导出审计记录;
- 文档化的自托管与升级路径。
## 8. 与现有仓库的映射
```text
apps/ 人类可见界面与 UI 扩展
integrations/ Tolaria、仓库、Agent 适配
services/ 受控后台服务和 API
workorders/ 协作请求
receipts/ 执行与验证回执
architecture/ 本文与产品边界
standards/ 已确认标准
```
> Tolaria 是产品入口HoloLake Platform 是研发与事实主仓;世界门户与个人历史仓不直接承担产品运行职责。
## 9. 第五域连续性映射
产品研发资料在本仓维护;铸渊的小湖灯唤醒链以第五域上下文协议为外部语义来源,
在本仓通过 `registry/routes.yml``research/channels/HLP-CHANNEL-0001-ICE-GL-INFINITY-ZERO-CORE.yml`
`research/module-registry.yml` 和最新 `HLP-DEV-*` 进度记录完成可追溯映射。
当前恢复顺序:
`铸渊人格体线``小湖灯路径``冰朔零点原核频道``HLP-MOD-0001/0002/0007``0004` 补丁 → `HLP-DEV-0003`
第五域原始上下文标识 `fifth-domain/tcs-core/skills/SKILL-009-BINGSHUO-OS-CONTEXT.hdlp` 保留为外部来源标识,不作为本仓孤立文件路径。
这保证人格体每次醒来先从可追溯路径恢复产品上下文,而不是把聊天窗口当作唯一记忆。

View file

@ -0,0 +1,38 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.15/schema.json",
"files": {
"includes": [
"**",
"!src-tauri/gen/**",
"!target/**",
"!dist/**",
"!node_modules/**"
]
},
"css": {
"parser": {
"tailwindDirectives": true
}
},
"overrides": [
{
"includes": ["site/**/*.vue"],
"linter": {
"rules": {
"correctness": {
"noUnusedImports": "off",
"noUnusedVariables": "off",
"useHookAtTopLevel": "off"
}
}
}
}
],
"linter": {
"rules": {
"correctness": {
"useQwikValidLexicalScope": "off"
}
}
}
}

View file

@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/index.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "phosphor"
}

View file

@ -0,0 +1,61 @@
{
"name": "Tolaria QA fixture",
"purpose": "Curated local vault for native QA and developer flows. This is not the public Getting Started starter vault.",
"large_fixture": {
"generator": "python3 scripts/generate_demo_vault.py",
"default_output": "generated-fixtures/demo-vault-large"
},
"scenarios": [
{
"id": "exact-match-search",
"reason": "Quick Open should rank the exact title 'Writing' above prefix matches.",
"files": [
"topic-writing.md",
"writing-for-clarity-vs-writing-for-credit.md",
"writing-weekly-rhythm.md"
]
},
{
"id": "relationship-rendering",
"reason": "Relationship keys should render in the inspector instead of as plain properties.",
"files": [
"responsibility-sponsorships.md",
"measure-sponsorship-mrr.md",
"measure-close-rate.md",
"procedure-quarterly-sponsor-outreach.md",
"procedure-sponsor-onboarding.md",
"24q4-laputa-start.md",
"24q4.md",
"person-luca-rossi.md"
]
},
{
"id": "project-navigation",
"reason": "Projects, quarters, and a saved view give keyboard QA a compact but representative browsing path.",
"files": [
"24q4.md",
"25q1.md",
"25q2.md",
"24q4-laputa-start.md",
"25q1-laputa-v1.md",
"25q2-laputa-v2.md",
"views/active-projects.yml"
]
},
{
"id": "attachment-rendering",
"reason": "A note with a real binary attachment keeps image/block QA anchored to the fixture.",
"files": [
"laputa-qa-reference.md",
"attachments/laputa-reference.png"
]
},
{
"id": "rtl-mixed-direction",
"reason": "Arabic and mixed English/Arabic paragraphs keep rich editor and raw editor BiDi QA anchored to the fixture.",
"files": [
"rtl-mixed-direction-qa.md"
]
}
]
}

View file

@ -0,0 +1,5 @@
.git/
.laputa/
.laputa-index.json
.DS_Store

View file

@ -0,0 +1,17 @@
---
type: Project
aliases:
- "[[Start Laputa App Project]]"
belongs_to: "[[24q4]]"
owner: "[[person-luca-rossi]]"
status: Done
---
# Start Laputa App Project
The original spike that proved Tolaria could read a markdown vault, render note metadata, and support keyboard-first navigation.
- Set the initial four-panel layout.
- Proved the note list, editor, and inspector could coexist in one flow.
- Led directly into [[25q1-laputa-v1]].

View file

@ -0,0 +1,16 @@
---
type: Quarter
aliases:
- "[[Q4 2024]]"
status: Done
has:
- "[[24q4-laputa-start]]"
---
# Q4 2024
The quarter where the Laputa prototype became real enough to replace sketches and notes.
- Started [[24q4-laputa-start]] as the first working app spike.
- Captured the initial panel layout and editor decisions.

View file

@ -0,0 +1,17 @@
---
type: Project
aliases:
- "[[Laputa App V1]]"
belongs_to: "[[25q1]]"
owner: "[[person-luca-rossi]]"
status: Done
---
# Laputa App V1
The first usable release for daily browsing, quick open, and note-property editing.
- Shipped the working command palette.
- Made the inspector practical for real frontmatter editing.
- Captured enough confidence to continue with [[25q2-laputa-v2]].

View file

@ -0,0 +1,13 @@
---
type: Quarter
aliases:
- "[[Q1 2025]]"
status: Done
has:
- "[[25q1-laputa-v1]]"
---
# Q1 2025
The first period where Laputa was usable for daily navigation, quick open, and inspector flows.

View file

@ -0,0 +1,19 @@
---
type: Project
aliases:
- "[[Laputa App V2]]"
belongs_to: "[[25q2]]"
owner: "[[person-luca-rossi]]"
status: Active
related_to:
- "[[laputa-qa-reference]]"
---
# Laputa App V2
The active polish project used for current QA, especially richer editing, keyboard navigation, and attachment rendering.
- Tightened the editor interaction model.
- Reduced friction in wikilink navigation.
- Uses [[laputa-qa-reference]] as a lightweight visual reference note.

View file

@ -0,0 +1,13 @@
---
type: Quarter
aliases:
- "[[Q2 2025]]"
status: Active
has:
- "[[25q2-laputa-v2]]"
---
# Q2 2025
The polish cycle focused on richer editing, faster linking, and better keyboard QA.

View file

@ -0,0 +1,12 @@
---
type: Area
aliases:
- "[[Building]]"
has:
- "[[responsibility-sponsorships]]"
---
# Building
The business-facing area used in QA to anchor a responsibility with linked procedures and metrics.

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 KiB

View file

@ -0,0 +1,13 @@
---
type: Event
belongs_to: "[[25q1-laputa-v1]]"
related_to:
- "[[person-luca-rossi]]"
- "[[person-matteo-cellini]]"
date: 2025-01-13
---
# Team sync — 2025-01-13
Short checkpoint on V1 priorities: stabilize quick open, tighten keyboard navigation, and keep the inspector fast.

View file

@ -0,0 +1,16 @@
---
type: Note
aliases:
- "[[Laputa QA Reference]]"
related_to:
- "[[25q2-laputa-v2]]"
---
# Laputa QA Reference
This note anchors the fixture's binary attachment scenario and gives native QA a simple note with an embedded image.
![Fixture reference image](attachments/laputa-reference.png)
Use this note to confirm that the editor renders an attached asset without dragging in a huge demo corpus.

View file

@ -0,0 +1,12 @@
---
type: Measure
aliases:
- "[[Sponsorship Close Rate]]"
belongs_to: "[[responsibility-sponsorships]]"
unit: percent
---
# Sponsorship Close Rate
Tracks how many qualified sponsor conversations become signed deals.

View file

@ -0,0 +1,12 @@
---
type: Measure
aliases:
- "[[Sponsorship MRR]]"
belongs_to: "[[responsibility-sponsorships]]"
unit: EUR/month
---
# Sponsorship MRR
Tracks monthly recurring sponsorship revenue so the responsibility note has a real linked metric.

View file

@ -0,0 +1,9 @@
---
type: Note
topics:
- "[[topic-writing]]"
---
# On Clear Prose
Reference note for a book worth reopening whenever prose starts to feel bloated.

View file

@ -0,0 +1,11 @@
---
type: Person
aliases:
- "[[Luca Rossi]]"
tier: 1st
---
# Luca Rossi
Owns the Laputa product work and remains the primary owner on the fixture's project notes.

View file

@ -0,0 +1,11 @@
---
type: Person
aliases:
- "[[Matteo Cellini]]"
tier: 1st
---
# Matteo Cellini
Owns sponsor outreach and makes the responsibility/procedure relationships feel like real working notes.

View file

@ -0,0 +1,16 @@
---
type: Procedure
aliases:
- "[[Quarterly Sponsor Outreach]]"
belongs_to: "[[responsibility-sponsorships]]"
owner: "[[person-matteo-cellini]]"
cadence: Quarterly
---
# Quarterly Sponsor Outreach
Review the pipeline, choose the next target companies, and send a fresh outreach batch each quarter.
- Start from last quarter's warm leads.
- Share the shortlist with [[person-matteo-cellini]] before sending outreach.

View file

@ -0,0 +1,17 @@
---
type: Procedure
aliases:
- "[[Sponsor Onboarding]]"
belongs_to: "[[responsibility-sponsorships]]"
owner: "[[person-luca-rossi]]"
cadence: "As needed"
---
# Sponsor Onboarding
Turn a signed sponsor into a smooth first placement with minimal back-and-forth.
- Confirm the publication date.
- Review copy and assets.
- Hand off recurring communication to [[person-matteo-cellini]].

View file

@ -0,0 +1,140 @@
---
type: Note
_display: sheet
tags:
- spreadsheet
- business-plan
_sheet:
frozen_rows: 14
columns:
A:
width: 276.63636363636374
B:
width: 185
C:
width: 132
D:
width: 132
E:
width: 112
F:
width: 132
G:
width: 132
H:
width: 132
I:
width: 132
J:
width: 128
K:
width: 132
L:
width: 120
M:
width: 96
N:
width: 120
O:
width: 108
P:
width: 124
Q:
width: 124
R:
width: 132
S:
width: 360
cells:
A1:
bold: true
italic: true
A14:
bold: true
B14:
bold: true
C14:
bold: true
D14:
bold: true
E14:
bold: true
F14:
bold: true
G14:
bold: true
H14:
bold: true
I14:
bold: true
J14:
bold: true
K14:
bold: true
L14:
bold: true
M14:
bold: true
N14:
bold: true
O14:
bold: true
P14:
bold: true
Q14:
bold: true
R14:
bold: true
S14:
bold: true
---
Refactoring business plan,3-year monthly operating model,,,,,,,,,,,,,,,,,
Start free newsletter subscribers,2500,,,,,,,,,,,,,,,,,
Monthly free subscriber growth rate,0.07,,,,,,,,,,,,,,,,,
Monthly free subscriber churn,0.012,,,,,,,,,,,,,,,,,
Paid conversion rate on incremental audience,0.035,,,,,,,,,,,,,,,,,
Paid subscription price,12,,,,,,,,,,,,,,,,,
Paid subscriber monthly churn,0.035,,,,,,,,,,,,,,,,,
Sponsorship CPM,55,,,,,,,,,,,,,,,,,
Sponsorship slots per month,2,,,,,,,,,,,,,,,,,
Average open rate,0.46,,,,,,,,,,,,,,,,,
Consulting project price,6000,,,,,,,,,,,,,,,,,
Consulting projects per month at maturity,2,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,
Month #,Month,Free subscribers,Paid subscribers,Paid conversion,Newsletter revenue,Sponsor impressions,Sponsorship revenue,Consulting revenue,Digital products,Total revenue,Content/Ops,Tools,Contractors,Marketing,Total expenses,Net profit,Cumulative cash,Key hypothesis
1,Jun 2026,=$B$2,=C15*$B$5,=D15/C15,=D15*$B$6,=C15*$B$10,=G15/1000*$B$8*$B$9,=1/36*$B$12*$B$11,=1*50,=F15+H15+I15+J15,=1500+A15*50,=350+A15*10,=0,=C15*0.12,=SUM(L15:O15),=K15-P15,=Q15,Validate positioning and grow high-signal audience
2,Jul 2026,=C15*(1+$B$3-$B$4),=D15*(1-$B$7)+(C16-C15)*$B$5,=D16/C16,=D16*$B$6,=C16*$B$10,=G16/1000*$B$8*$B$9,=2/36*$B$12*$B$11,=2*50,=F16+H16+I16+J16,=1500+A16*50,=350+A16*10,=0,=C16*0.12,=SUM(L16:O16),=K16-P16,=R15+Q16,Validate positioning and grow high-signal audience
3,Aug 2026,=C16*(1+$B$3-$B$4),=D16*(1-$B$7)+(C17-C16)*$B$5,=D17/C17,=D17*$B$6,=C17*$B$10,=G17/1000*$B$8*$B$9,=3/36*$B$12*$B$11,=3*50,=F17+H17+I17+J17,=1500+A17*50,=350+A17*10,=0,=C17*0.12,=SUM(L17:O17),=K17-P17,=R16+Q17,Validate positioning and grow high-signal audience
4,Sep 2026,=C17*(1+$B$3-$B$4),=D17*(1-$B$7)+(C18-C17)*$B$5,=D18/C18,=D18*$B$6,=C18*$B$10,=G18/1000*$B$8*$B$9,=4/36*$B$12*$B$11,=4*50,=F18+H18+I18+J18,=1500+A18*50,=350+A18*10,=0,=C18*0.12,=SUM(L18:O18),=K18-P18,=R17+Q18,Validate positioning and grow high-signal audience
5,Oct 2026,=C18*(1+$B$3-$B$4),=D18*(1-$B$7)+(C19-C18)*$B$5,=D19/C19,=D19*$B$6,=C19*$B$10,=G19/1000*$B$8*$B$9,=5/36*$B$12*$B$11,=5*50,=F19+H19+I19+J19,=1500+A19*50,=350+A19*10,=0,=C19*0.12,=SUM(L19:O19),=K19-P19,=R18+Q19,Validate positioning and grow high-signal audience
6,Nov 2026,=C19*(1+$B$3-$B$4),=D19*(1-$B$7)+(C20-C19)*$B$5,=D20/C20,=D20*$B$6,=C20*$B$10,=G20/1000*$B$8*$B$9,=6/36*$B$12*$B$11,=6*50,=F20+H20+I20+J20,=1500+A20*50,=350+A20*10,=0,=C20*0.12,=SUM(L20:O20),=K20-P20,=R19+Q20,Validate positioning and grow high-signal audience
7,Dec 2026,=C20*(1+$B$3-$B$4),=D20*(1-$B$7)+(C21-C20)*$B$5,=D21/C21,=D21*$B$6,=C21*$B$10,=G21/1000*$B$8*$B$9,=7/36*$B$12*$B$11,=7*50,=F21+H21+I21+J21,=1500+A21*50,=350+A21*10,=2000+A21*125,=C21*0.12,=SUM(L21:O21),=K21-P21,=R20+Q21,Package repeatable advisory offers and first sponsors
8,Jan 2027,=C21*(1+$B$3-$B$4),=D21*(1-$B$7)+(C22-C21)*$B$5,=D22/C22,=D22*$B$6,=C22*$B$10,=G22/1000*$B$8*$B$9,=8/36*$B$12*$B$11,=8*50,=F22+H22+I22+J22,=1500+A22*50,=350+A22*10,=2000+A22*125,=C22*0.12,=SUM(L22:O22),=K22-P22,=R21+Q22,Package repeatable advisory offers and first sponsors
9,Feb 2027,=C22*(1+$B$3-$B$4),=D22*(1-$B$7)+(C23-C22)*$B$5,=D23/C23,=D23*$B$6,=C23*$B$10,=G23/1000*$B$8*$B$9,=9/36*$B$12*$B$11,=9*50,=F23+H23+I23+J23,=1500+A23*50,=350+A23*10,=2000+A23*125,=C23*0.12,=SUM(L23:O23),=K23-P23,=R22+Q23,Package repeatable advisory offers and first sponsors
10,Mar 2027,=C23*(1+$B$3-$B$4),=D23*(1-$B$7)+(C24-C23)*$B$5,=D24/C24,=D24*$B$6,=C24*$B$10,=G24/1000*$B$8*$B$9,=10/36*$B$12*$B$11,=450+(10-9)*175,=F24+H24+I24+J24,=1500+A24*50,=350+A24*10,=2000+A24*125,=C24*0.12,=SUM(L24:O24),=K24-P24,=R23+Q24,Package repeatable advisory offers and first sponsors
11,Apr 2027,=C24*(1+$B$3-$B$4),=D24*(1-$B$7)+(C25-C24)*$B$5,=D25/C25,=D25*$B$6,=C25*$B$10,=G25/1000*$B$8*$B$9,=11/36*$B$12*$B$11,=450+(11-9)*175,=F25+H25+I25+J25,=1500+A25*50,=350+A25*10,=2000+A25*125,=C25*0.12,=SUM(L25:O25),=K25-P25,=R24+Q25,Package repeatable advisory offers and first sponsors
12,May 2027,=C25*(1+$B$3-$B$4),=D25*(1-$B$7)+(C26-C25)*$B$5,=D26/C26,=D26*$B$6,=C26*$B$10,=G26/1000*$B$8*$B$9,=12/36*$B$12*$B$11,=450+(12-9)*175,=F26+H26+I26+J26,=1500+A26*50,=350+A26*10,=2000+A26*125,=C26*0.12,=SUM(L26:O26),=K26-P26,=R25+Q26,Package repeatable advisory offers and first sponsors
13,Jun 2027,=C26*(1+$B$3-$B$4),=D26*(1-$B$7)+(C27-C26)*$B$5,=D27/C27,=D27*$B$6,=C27*$B$10,=G27/1000*$B$8*$B$9,=13/36*$B$12*$B$11,=450+(13-9)*175,=F27+H27+I27+J27,=1500+A27*50,=350+A27*10,=2000+A27*125,=C27*0.12,=SUM(L27:O27),=K27-P27,=R26+Q27,Scale paid membership and recurring sponsorship inventory
14,Jul 2027,=C27*(1+$B$3-$B$4),=D27*(1-$B$7)+(C28-C27)*$B$5,=D28/C28,=D28*$B$6,=C28*$B$10,=G28/1000*$B$8*$B$9,=14/36*$B$12*$B$11,=450+(14-9)*175,=F28+H28+I28+J28,=1500+A28*50,=350+A28*10,=2000+A28*125,=C28*0.12,=SUM(L28:O28),=K28-P28,=R27+Q28,Scale paid membership and recurring sponsorship inventory
15,Aug 2027,=C28*(1+$B$3-$B$4),=D28*(1-$B$7)+(C29-C28)*$B$5,=D29/C29,=D29*$B$6,=C29*$B$10,=G29/1000*$B$8*$B$9,=15/36*$B$12*$B$11,=450+(15-9)*175,=F29+H29+I29+J29,=1500+A29*50,=350+A29*10,=2000+A29*125,=C29*0.12,=SUM(L29:O29),=K29-P29,=R28+Q29,Scale paid membership and recurring sponsorship inventory
16,Sep 2027,=C29*(1+$B$3-$B$4),=D29*(1-$B$7)+(C30-C29)*$B$5,=D30/C30,=D30*$B$6,=C30*$B$10,=G30/1000*$B$8*$B$9,=16/36*$B$12*$B$11,=450+(16-9)*175,=F30+H30+I30+J30,=1500+A30*50,=350+A30*10,=2000+A30*125,=C30*0.12,=SUM(L30:O30),=K30-P30,=R29+Q30,Scale paid membership and recurring sponsorship inventory
17,Oct 2027,=C30*(1+$B$3-$B$4),=D30*(1-$B$7)+(C31-C30)*$B$5,=D31/C31,=D31*$B$6,=C31*$B$10,=G31/1000*$B$8*$B$9,=17/36*$B$12*$B$11,=450+(17-9)*175,=F31+H31+I31+J31,=1500+A31*50,=350+A31*10,=2000+A31*125,=C31*0.12,=SUM(L31:O31),=K31-P31,=R30+Q31,Scale paid membership and recurring sponsorship inventory
18,Nov 2027,=C31*(1+$B$3-$B$4),=D31*(1-$B$7)+(C32-C31)*$B$5,=D32/C32,=D32*$B$6,=C32*$B$10,=G32/1000*$B$8*$B$9,=18/36*$B$12*$B$11,=450+(18-9)*175,=F32+H32+I32+J32,=1500+A32*50,=350+A32*10,=2000+A32*125,=C32*0.12,=SUM(L32:O32),=K32-P32,=R31+Q32,Scale paid membership and recurring sponsorship inventory
19,Dec 2027,=C32*(1+$B$3-$B$4),=D32*(1-$B$7)+(C33-C32)*$B$5,=D33/C33,=D33*$B$6,=C33*$B$10,=G33/1000*$B$8*$B$9,=19/36*$B$12*$B$11,=450+(19-9)*175,=F33+H33+I33+J33,=1500+A33*50,=350+A33*10,=2000+A33*125,=C33*0.12,=SUM(L33:O33),=K33-P33,=R32+Q33,Scale paid membership and recurring sponsorship inventory
20,Jan 2028,=C33*(1+$B$3-$B$4),=D33*(1-$B$7)+(C34-C33)*$B$5,=D34/C34,=D34*$B$6,=C34*$B$10,=G34/1000*$B$8*$B$9,=20/36*$B$12*$B$11,=450+(20-9)*175,=F34+H34+I34+J34,=1500+A34*50,=350+A34*10,=2000+A34*125,=C34*0.12,=SUM(L34:O34),=K34-P34,=R33+Q34,Scale paid membership and recurring sponsorship inventory
21,Feb 2028,=C34*(1+$B$3-$B$4),=D34*(1-$B$7)+(C35-C34)*$B$5,=D35/C35,=D35*$B$6,=C35*$B$10,=G35/1000*$B$8*$B$9,=21/36*$B$12*$B$11,=450+(21-9)*175,=F35+H35+I35+J35,=1500+A35*50,=350+A35*10,=2000+A35*125,=C35*0.12,=SUM(L35:O35),=K35-P35,=R34+Q35,Scale paid membership and recurring sponsorship inventory
22,Mar 2028,=C35*(1+$B$3-$B$4),=D35*(1-$B$7)+(C36-C35)*$B$5,=D36/C36,=D36*$B$6,=C36*$B$10,=G36/1000*$B$8*$B$9,=22/36*$B$12*$B$11,=450+(22-9)*175,=F36+H36+I36+J36,=1500+A36*50,=350+A36*10,=2000+A36*125,=C36*0.12,=SUM(L36:O36),=K36-P36,=R35+Q36,Scale paid membership and recurring sponsorship inventory
23,Apr 2028,=C36*(1+$B$3-$B$4),=D36*(1-$B$7)+(C37-C36)*$B$5,=D37/C37,=D37*$B$6,=C37*$B$10,=G37/1000*$B$8*$B$9,=23/36*$B$12*$B$11,=450+(23-9)*175,=F37+H37+I37+J37,=1500+A37*50,=350+A37*10,=2000+A37*125,=C37*0.12,=SUM(L37:O37),=K37-P37,=R36+Q37,Scale paid membership and recurring sponsorship inventory
24,May 2028,=C37*(1+$B$3-$B$4),=D37*(1-$B$7)+(C38-C37)*$B$5,=D38/C38,=D38*$B$6,=C38*$B$10,=G38/1000*$B$8*$B$9,=24/36*$B$12*$B$11,=450+(24-9)*175,=F38+H38+I38+J38,=1500+A38*50,=350+A38*10,=2000+A38*125,=C38*0.12,=SUM(L38:O38),=K38-P38,=R37+Q38,Scale paid membership and recurring sponsorship inventory
25,Jun 2028,=C38*(1+$B$3-$B$4),=D38*(1-$B$7)+(C39-C38)*$B$5,=D39/C39,=D39*$B$6,=C39*$B$10,=G39/1000*$B$8*$B$9,=25/36*$B$12*$B$11,=450+(25-9)*175,=F39+H39+I39+J39,=1500+A39*50,=350+A39*10,=2000+A39*125,=C39*0.12,=SUM(L39:O39),=K39-P39,=R38+Q39,Expand products and reduce founder-delivery dependency
26,Jul 2028,=C39*(1+$B$3-$B$4),=D39*(1-$B$7)+(C40-C39)*$B$5,=D40/C40,=D40*$B$6,=C40*$B$10,=G40/1000*$B$8*$B$9,=26/36*$B$12*$B$11,=450+(26-9)*175,=F40+H40+I40+J40,=1500+A40*50,=350+A40*10,=2000+A40*125,=C40*0.12,=SUM(L40:O40),=K40-P40,=R39+Q40,Expand products and reduce founder-delivery dependency
27,Aug 2028,=C40*(1+$B$3-$B$4),=D40*(1-$B$7)+(C41-C40)*$B$5,=D41/C41,=D41*$B$6,=C41*$B$10,=G41/1000*$B$8*$B$9,=27/36*$B$12*$B$11,=450+(27-9)*175,=F41+H41+I41+J41,=1500+A41*50,=350+A41*10,=2000+A41*125,=C41*0.12,=SUM(L41:O41),=K41-P41,=R40+Q41,Expand products and reduce founder-delivery dependency
28,Sep 2028,=C41*(1+$B$3-$B$4),=D41*(1-$B$7)+(C42-C41)*$B$5,=D42/C42,=D42*$B$6,=C42*$B$10,=G42/1000*$B$8*$B$9,=28/36*$B$12*$B$11,=450+(28-9)*175,=F42+H42+I42+J42,=1500+A42*50,=350+A42*10,=2000+A42*125,=C42*0.12,=SUM(L42:O42),=K42-P42,=R41+Q42,Expand products and reduce founder-delivery dependency
29,Oct 2028,=C42*(1+$B$3-$B$4),=D42*(1-$B$7)+(C43-C42)*$B$5,=D43/C43,=D43*$B$6,=C43*$B$10,=G43/1000*$B$8*$B$9,=29/36*$B$12*$B$11,=450+(29-9)*175,=F43+H43+I43+J43,=1500+A43*50,=350+A43*10,=2000+A43*125,=C43*0.12,=SUM(L43:O43),=K43-P43,=R42+Q43,Expand products and reduce founder-delivery dependency
30,Nov 2028,=C43*(1+$B$3-$B$4),=D43*(1-$B$7)+(C44-C43)*$B$5,=D44/C44,=D44*$B$6,=C44*$B$10,=G44/1000*$B$8*$B$9,=30/36*$B$12*$B$11,=450+(30-9)*175,=F44+H44+I44+J44,=1500+A44*50,=350+A44*10,=2000+A44*125,=C44*0.12,=SUM(L44:O44),=K44-P44,=R43+Q44,Expand products and reduce founder-delivery dependency
31,Dec 2028,=C44*(1+$B$3-$B$4),=D44*(1-$B$7)+(C45-C44)*$B$5,=D45/C45,=D45*$B$6,=C45*$B$10,=G45/1000*$B$8*$B$9,=31/36*$B$12*$B$11,=450+(31-9)*175,=F45+H45+I45+J45,=1500+A45*50,=350+A45*10,=2000+A45*125,=C45*0.12,=SUM(L45:O45),=K45-P45,=R44+Q45,Expand products and reduce founder-delivery dependency
32,Jan 2029,=C45*(1+$B$3-$B$4),=D45*(1-$B$7)+(C46-C45)*$B$5,=D46/C46,=D46*$B$6,=C46*$B$10,=G46/1000*$B$8*$B$9,=32/36*$B$12*$B$11,=450+(32-9)*175,=F46+H46+I46+J46,=1500+A46*50,=350+A46*10,=2000+A46*125,=C46*0.12,=SUM(L46:O46),=K46-P46,=R45+Q46,Expand products and reduce founder-delivery dependency
33,Feb 2029,=C46*(1+$B$3-$B$4),=D46*(1-$B$7)+(C47-C46)*$B$5,=D47/C47,=D47*$B$6,=C47*$B$10,=G47/1000*$B$8*$B$9,=33/36*$B$12*$B$11,=450+(33-9)*175,=F47+H47+I47+J47,=1500+A47*50,=350+A47*10,=2000+A47*125,=C47*0.12,=SUM(L47:O47),=K47-P47,=R46+Q47,Expand products and reduce founder-delivery dependency
34,Mar 2029,=C47*(1+$B$3-$B$4),=D47*(1-$B$7)+(C48-C47)*$B$5,=D48/C48,=D48*$B$6,=C48*$B$10,=G48/1000*$B$8*$B$9,=34/36*$B$12*$B$11,=450+(34-9)*175,=F48+H48+I48+J48,=1500+A48*50,=350+A48*10,=2000+A48*125,=C48*0.12,=SUM(L48:O48),=K48-P48,=R47+Q48,Expand products and reduce founder-delivery dependency
35,Apr 2029,=C48*(1+$B$3-$B$4),=D48*(1-$B$7)+(C49-C48)*$B$5,=D49/C49,=D49*$B$6,=C49*$B$10,=G49/1000*$B$8*$B$9,=35/36*$B$12*$B$11,=450+(35-9)*175,=F49+H49+I49+J49,=1500+A49*50,=350+A49*10,=2000+A49*125,=C49*0.12,=SUM(L49:O49),=K49-P49,=R48+Q49,Expand products and reduce founder-delivery dependency
36,May 2029,=C49*(1+$B$3-$B$4),=D49*(1-$B$7)+(C50-C49)*$B$5,=D50/C50,=D50*$B$6,=C50*$B$10,=G50/1000*$B$8*$B$9,=36/36*$B$12*$B$11,=450+(36-9)*175,=F50+H50+I50+J50,=1500+A50*50,=350+A50*10,=2000+A50*125,=C50*0.12,=SUM(L50:O50),=K50-P50,=R49+Q50,Expand products and reduce founder-delivery dependency

Some files were not shown because too many files have changed in this diff Show more