chore: import sanitized domestic snapshot for REPO-004
Some checks failed
Auto-update PR branches / Update open PR branches (push) Has been cancelled
CI / Frontend Static Quality Checks (push) Has been cancelled
CI / Frontend Tests & Coverage (push) Has been cancelled
CI / Rust Tests & Quality Checks (push) Has been cancelled
CI / Linux build verification (push) Has been cancelled
Deploy docs / Build VitePress site (push) Has been cancelled
Release (Alpha) / Compute alpha version (push) Has been cancelled
Deploy docs / Deploy to GitHub Pages (push) Has been cancelled
Release (Alpha) / Build release artifacts (push) Has been cancelled
Release (Alpha) / GitHub Release (alpha) (push) Has been cancelled
Release (Alpha) / Update docs and release pages (push) Has been cancelled

Source snapshot: 514ab1975951d94342ea38e64101d5a0f1c51c77
This commit is contained in:
Guanghu Domestic Migration 2026-07-17 15:55:28 +08:00
commit 9b41d51231
2115 changed files with 439845 additions and 0 deletions

63
.chunk/README.md Normal file
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.

157
.chunk/config.json Normal file
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"

30
.chunk/run-rust-gate.sh Normal file
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"

395
.chunk/run-sidecar-gates-local.sh Executable file
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

115
.chunk/run-sidecar-gates.sh Normal file
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

136
.chunk/run-sidecar-lane.sh Executable file
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(*)"
]
}
}

21
.codacy.yaml Normal file
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"

2
.codescene-thresholds Normal file
View File

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

5
.codesceneignore Normal file
View File

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

9
.codescenerc Normal file
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."
}

18
.env.example Normal file
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=

3
.githooks-info Normal file
View File

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

3
.github/FUNDING.yml vendored Normal file
View File

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

64
.github/HOOKS.md vendored Normal file
View File

@ -0,0 +1,64 @@
# 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.
## Policy
- Commit on `main` only.
- Push from `main` to `origin/main` only.
- Never use `--no-verify`.
- `.codescene-thresholds` is a ratchet. It can only move up.
## Pre-commit
`.husky/pre-commit` blocks commits unless all of the following are true:
- `HEAD` is attached to `main`
- staged TypeScript files pass `pnpm lint --quiet`
- TypeScript passes `npx tsc --noEmit`
- frontend tests pass via `pnpm test --run --silent`
- current CodeScene Hotspot and Average health are both at or above `.codescene-thresholds`
If `CODESCENE_PAT` or `CODESCENE_PROJECT_ID` is missing, the CodeScene portion is skipped, but the rest of the hook still runs.
## Pre-push
`.husky/pre-push` blocks pushes unless all of the following are true:
- the current branch is `main`
- every pushed branch ref is `refs/heads/main -> 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.
## 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.

227
.github/SETUP.md vendored Normal file
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]`.

26
.github/hooks/install-hooks.sh vendored Executable file
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."

81
.github/hooks/pre-commit vendored Normal file
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."

137
.github/scripts/prefetch-tauri-nsis.ps1 vendored Normal file
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."

133
.github/workflows/README.md vendored Normal file
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.

38
.github/workflows/auto-update-prs.yml vendored Normal file
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

296
.github/workflows/ci.yml vendored Normal file
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

104
.github/workflows/deploy-docs.yml vendored Normal file
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="REDACTED_PASSWORD"
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

300
.github/workflows/release-stable.yml vendored Normal file
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 }}."

410
.github/workflows/release.yml vendored Normal file
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

81
.gitignore vendored Normal file
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/

55
.husky/pre-commit Executable file
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"

338
.husky/pre-push Executable file
View File

@ -0,0 +1,338 @@
#!/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
ensure_node_tooling
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 "")
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
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
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 ""

10
.semgrepignore Normal file
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

194
AGENTS.md Normal file
View File

@ -0,0 +1,194 @@
# AGENTS.md — Tolaria App
## 1. Development Process
### Start working on a task
**Before writing a single line of code:** run `mcp__codescene__code_health_score` to check the current codebase health against `.codescene-thresholds`. If the score is already below the threshold, **stop and refactor first** — find the worst files with the MCP, improve them, commit, then start the task. Never start feature work on a codebase that is already below the gate.
- 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.
- Commit every 2030 min: `feat:`, `fix:`, `refactor:`, `test:`, `docs:`
- Pre-commit is a lightweight lint gate only. Pre-push runs the full check suite (build + tests + coverage + core Playwright smoke + CodeScene), preferably on three Chunk sidecar lanes for automatic test/coverage work: frontend lint/build/coverage, Rust coverage, and Playwright smoke. The goal is lower wall-clock time than local hooks while keeping each heavy gate isolated; keep local Playwright mainly for authoring, focused reproduction, or sidecar outages.
- **A task is NOT done until `git push origin main` succeeds.** If the hook blocks: read the error, fix it (clippy, tests, CodeScene, build), commit the fix, push again. **⛔ 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)
Pre-push enforces **Hotspot Code Health** and **Average Code Health** ≥ thresholds in `.codescene-thresholds`. Pre-commit is lint-only; CodeScene remains mandatory through the file-level review rules below and the pre-push ratchet gate. Thresholds are a **ratchet** — only go up. When pre-push sees improved remote scores, it updates `.codescene-thresholds`, stages it, and stops so you can commit the new floor with normal verified hooks before pushing again. Never add `// eslint-disable`, `#[allow(...)]`, or `as any`.
**Release rule:** CodeScene is a before/after gate, not just a final score. Every task must record the starting CodeScene 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 available. If MCP is unavailable, use the installed `cs` CLI for file-level review/delta work, and use the CodeScene API (`CODESCENE_PAT` + `CODESCENE_PROJECT_ID`) for project-wide Hotspot/Average threshold checks from `.codescene-thresholds`.
**Before editing any existing code file:** capture its current file-level CodeScene score. After your edits, re-run the same file-level review and verify the score is higher. If the file already starts at `10.0`, it must remain `10.0`.
**New files:** every new **scorable code file** must reach CodeScene score `10.0` before commit. If CodeScene reports `null` / "no scorable code" for a new file, it must still have zero CodeScene findings/warnings.
**Before every commit:** run CodeScene file-level review on every touched or newly created code file and verify the rule above. **Boy Scout Rule:** every file you touch must leave with a higher score, unless it was already `10.0`, in which case it must stay `10.0`.
**If CodeScene gate blocks your push:** use `mcp__codescene__code_health_score` to find the worst file, refactor it, commit, push again. Do NOT stop or wait for laputa-refactor — that is a background loop, not a substitute for fixing your own regressions.
### 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 plus final Hotspot and Average scores after push; final scores must pass `.codescene-thresholds`.
- 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.

8
CLAUDE.md Normal file
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`.

49
CONTRIBUTING.md Normal file
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.

8
GEMINI.md Normal file
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`.

661
LICENSE Normal file
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/>.

201
README.md Normal file
View File

@ -0,0 +1,201 @@
# 🔧 Tolaria 零件仓库(REPO-004)
> **本仓库 = 零件仓库,不是开发主仓库。**
> **冰朔 D165 · 2026-07-05 重划**
本仓库是 [Tolaria](https://github.com/refactoringhq/tolaria) 的 fork,作为光湖人格体的**零件源头**——不用于开发,只用于 rebase 上游,保留所有组件供光湖人格体按需挑选复用,避免重复造轮子。
上游采用 AGPL-3.0-or-later,本仓库继续遵守同一许可证并保留完整历史。
## 仓库角色(D165 19:23 冰朔亲口裁定)
- **角色:** 持续同步上游的"零件组件库" —— 不发布应用、不接受开发 PR、不作为光湖开发主仓库
- **维护:** 冰朔 · REPO 编号 = `REPO-004`
- **工作流:** 上游 `refactoringhq/tolaria` 一旦发 alpha,本仓库 rebase 同步 → 上游所有更新以 commit 形式保留 → 光湖人格体随时可以 `git log upstream/main` 找新零件
- **应用内更新:** 关闭(本仓库不参与光湖产品发布链)
## 光湖真正的开发主仓库 = REPO-005(待建)
本仓库之外的"光湖真正动代码的地方":
```
REPO-005 = bingshuo/guanghu-research ⏳ 待建 · 企业门户服务器下
```
人格体需要"找零件做组件"时去 R-004。
人格体需要"开发新模块写光湖产品"时去 R-005。
## 跨仓库编号 · REPO 体系
详见 [`REPO-004` 编号字典 · 第五域仓库](../fifth-domain/.code-map)
```
REPO-001 = bingshuo/fifth-domain 现行主仓库 · 个人作品
REPO-002 = bingshuo/guanghulab 历史档案 · 留痕区
REPO-003 = bingshuo/tolaria-src Tolaria 上游纯净镜像(可能并入 REPO-005)
REPO-004 = bingshuo/guanghu ← 本仓库 · 零件仓库
REPO-005 = bingshuo/guanghu-research ⏳ 光湖研发 · 待建
```
---
## Tolaria 上游说明
Tolaria 提供了跨平台 Markdown 知识库的基础能力。光湖在此基础上挑选零件,
不重造轮子。上游版权与贡献者署名保持不变。
---
## Tolaria 上游能力介绍
Tolaria is a desktop app for macOS, Windows, and Linux for managing **markdown knowledge bases**. People use it for a variety of use cases:
* Operate second brains and personal knowledge
* Organize company docs as context for AI
* Store OpenClaw/assistants memory and procedures
Personally, I use it to **run my life** (hey 👋 [Luca here](http://x.com/lucaronin)). I have a massive workspace of 10,000+ notes, which are the result of my [Refactoring](https://refactoring.fm/) work + a ton of personal journaling and *second braining*.
<img width="1000" height="656" alt="1776506856823-CleanShot_2026-04-18_at_12 06 57_2x" src="https://github.com/user-attachments/assets/8aeafb0a-b236-43c2-a083-ec111f903c38" />
## Sponsors
Tolaria is supported by a small panel of tools that help keep the project healthy, tested, and ready for AI-assisted development. I use these tools every day.
<table>
<tr>
<td align="center" width="25%">
<a href="https://www.codacy.com/">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/refactoringhq/tolaria/main/site/public/landing/sponsors/codacy-light.svg">
<img src="https://raw.githubusercontent.com/refactoringhq/tolaria/main/site/public/landing/sponsors/codacy-dark.svg" alt="Codacy" height="32">
</picture>
</a>
</td>
<td align="center" width="25%">
<a href="https://codescene.com/">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/refactoringhq/tolaria/main/site/public/landing/sponsors/codescene-light.svg">
<img src="https://raw.githubusercontent.com/refactoringhq/tolaria/main/site/public/landing/sponsors/codescene-dark.svg" alt="CodeScene" height="32">
</picture>
</a>
</td>
<td align="center" width="25%">
<a href="https://circleci.com/">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/refactoringhq/tolaria/main/site/public/landing/sponsors/circleci-light.svg">
<img src="https://raw.githubusercontent.com/refactoringhq/tolaria/main/site/public/landing/sponsors/circleci-dark.svg" alt="CircleCI" height="32">
</picture>
</a>
</td>
<td align="center" width="25%">
<a href="https://getunblocked.com/">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/refactoringhq/tolaria/main/site/public/landing/sponsors/unblocked-light.svg">
<img src="https://raw.githubusercontent.com/refactoringhq/tolaria/main/site/public/landing/sponsors/unblocked-dark.svg" alt="Unblocked" height="32">
</picture>
</a>
</td>
</tr>
</table>
## Walkthroughs
You can find some Loom walkthroughs below — they are short and to the point:
- [How I Organize My Own Tolaria Workspace](https://www.loom.com/share/bb3aaffa238b4be0bd62e4464bca2528)
- [My Inbox Workflow](https://www.loom.com/share/dffda263317b4fa8b47b59cdf9330571)
- [How I Save Web Resources to Tolaria](https://www.loom.com/share/8a3c1776f801402ebbf4d7b0f31e9882)
## Principles
- 📑 **Files-first** — Your notes are plain markdown files. They're portable, work with any editor, and require no export step. Your data belongs to you, not to any app.
- 🔌 **Git-first** — Every vault is a git repository. You get full version history, the ability to use any git remote, and zero dependency on Tolaria servers.
- 🛜 **Offline-first, zero lock-in** — No accounts, no subscriptions, no cloud dependencies. Your vault works completely offline and always will. If you stop using Tolaria, you lose nothing.
- 🔬 **Open source** — Tolaria is free and open source. I built this for [myself](https://x.com/lucaronin) and for sharing it with others.
- 📋 **Standards-based** — Notes are markdown files with YAML frontmatter. No proprietary formats, no locked-in data. Everything works with standard tools if you decide to move away from Tolaria.
- 🔍 **Types as lenses, not schemas** — Types in Tolaria are navigation aids, not enforcement mechanisms. There's no required fields, no validation, just helpful categories for finding notes.
- 🪄**AI-first but not AI-only** — A vault of files works very well with AI agents, but you are free to use whatever you want. We support Claude Code, Codex CLI, and Gemini CLI setup paths, but you can edit the vault with any AI you want. We provide an AGENTS file for your agents to figure out.
- ⌨️ **Keyboard-first** — Tolaria is designed for power-users who want to use keyboard as much as possible. A lot of how we designed the Editor and the Command Palette is based on this.
- 💪 **Built from real use** — Tolaria was created for manage my personal vault of 10,000+ notes, and I use it every day. Every feature exists because it solved a real problem.
## Installation
### Homebrew
Install via Homebrew on macOS:
```batch
brew install --cask tolaria
```
### Download from releases
Download the [latest release here](https://refactoringhq.github.io/tolaria/download/) for macOS, Windows, or Linux. Windows installers are Authenticode-signed; company-managed devices may still require IT approval of the Tolaria publisher before first install.
## Getting started
When you open Tolaria for the first time you get the chance of cloning the [getting started vault](https://github.com/refactoringhq/tolaria-getting-started) — which gives you a walkthrough of the whole app.
The public user docs live in [`site/`](site/) and are published to GitHub Pages. Start with [Install Tolaria](site/start/install.md), then [First Launch](site/start/first-launch.md).
## Open source and local setup
Tolaria is open source and built with Tauri, React, and TypeScript. If you want to run or contribute to the app locally, here is [how to get started](https://github.com/refactoringhq/tolaria/blob/main/docs/GETTING-STARTED.md). You can also find the gist below 👇
### Prerequisites
- Node.js 20+
- pnpm 8+
- Rust stable
- macOS or Linux for development
#### Linux system dependencies
Tauri 2 on Linux requires WebKit2GTK 4.1 and GTK 3:
- Arch / Manjaro:
```bash
sudo pacman -S --needed webkit2gtk-4.1 base-devel curl wget file openssl \
appmenu-gtk-module libappindicator-gtk3 librsvg
```
- Debian / Ubuntu (22.04+):
```bash
sudo apt install libwebkit2gtk-4.1-dev build-essential curl wget file \
libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev \
libsoup-3.0-dev patchelf
```
- Fedora 38+:
```bash
sudo dnf install webkit2gtk4.1-devel openssl-devel curl wget file \
libappindicator-gtk3-devel librsvg2-devel
```
The bundled MCP server still spawns the system `node` binary at runtime on Linux, so install Node from your distro package manager if you want the external AI tooling flow.
### Quick start
```bash
pnpm install
pnpm dev
```
Open `http://localhost:5173` for the browser-based mock mode, or run the native desktop app with:
```bash
pnpm tauri dev
```
## Tech Docs
- 📐 [ARCHITECTURE.md](docs/ARCHITECTURE.md) — System design, tech stack, data flow
- 🧩 [ABSTRACTIONS.md](docs/ABSTRACTIONS.md) — Core abstractions and models
- 🚀 [GETTING-STARTED.md](docs/GETTING-STARTED.md) — How to navigate the codebase
- 📚 [ADRs](docs/adr) — Architecture Decision Records
## Security
If you believe you have found a security issue, please report it privately as described in [SECURITY.md](./SECURITY.md).
## License
Tolaria is licensed under AGPL-3.0-or-later. The Tolaria name and logo remain covered by the projects trademark policy.

55
SECURITY.md Normal file
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.

14
UPSTREAM.md Normal file
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 网络不可用,光湖远端首次发布采用完整源码快照。
上游作者、许可证和来源不因快照发布而改变。网络恢复后可补充完整上游历史镜像。

38
biome.json Normal file
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"
}
}
}
}

21
components.json Normal file
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"
]
}
]
}

5
demo-vault-v2/.gitignore vendored Normal file
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]].

16
demo-vault-v2/24q4.md Normal file
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]].

13
demo-vault-v2/25q1.md Normal file
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.

13
demo-vault-v2/25q2.md Normal file
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

View File

@ -0,0 +1,21 @@
---
type: Responsibility
aliases:
- "[[Sponsorships]]"
belongs_to: "[[area-building]]"
has_measures:
- "[[measure-sponsorship-mrr]]"
- "[[measure-close-rate]]"
has_procedures:
- "[[procedure-quarterly-sponsor-outreach]]"
- "[[procedure-sponsor-onboarding]]"
status: Open
---
# Sponsorships
The compact responsibility used to verify that wikilink-valued fields render as relationships instead of plain text properties.
- `status` stays a normal property.
- `has_measures` and `has_procedures` should render in the relationships area.

View File

@ -0,0 +1,17 @@
---
type: Note
topics:
- "[[topic-writing]]"
---
# RTL Mixed Direction QA
مرحبا بالعالم. هذه فقرة عربية لاختبار اتجاه النص من اليمين إلى اليسار داخل محرر تولاريا.
English text should keep reading left to right when it appears next to Arabic content.
English then مرحبا بالعالم keeps both scripts readable on one line.
مرحبا بالعالم then English keeps the Arabic run anchored correctly while preserving the English words.
Use this note when checking rich editor and raw Markdown editor behavior for automatic LTR/RTL direction.

View File

@ -0,0 +1,30 @@
---
type: Note
_display: sheet
tags:
- spreadsheet
_sheet:
frozen_rows: 1
columns:
A:
width: 180
B:
width: 140
C:
width: 140
D:
width: 140
E:
width: 140
cells:
A2:
bold: true
A5:
bold: true
---
Metric,January,February,March,Quarter
Subscriptions,1200,1350,1500,=SUM(B2:D2)
Services,800,900,700,=SUM(B3:D3)
Expenses,650,700,760,=SUM(B4:D4)
Net,=B2+B3-B4,=C2+C3-C4,=D2+D3-D4,=SUM(B5:D5)
Growth,,=(C5-B5)/B5,=(D5-C5)/C5,=(E5-B5)/B5

View File

@ -0,0 +1,13 @@
---
type: Topic
aliases:
- "[[Writing]]"
---
# Writing
The exact-match Quick Open target for search ranking QA.
- [[writing-for-clarity-vs-writing-for-credit]]
- [[writing-weekly-rhythm]]
- [[note-on-clear-prose]]

View File

@ -0,0 +1,11 @@
---
type: Type
icon: folders
color: amber
sidebar label: Areas
---
# Area
Areas are ongoing domains of responsibility with no fixed end date.

View File

@ -0,0 +1,11 @@
---
type: Type
icon: calendar
color: orange
sidebar label: Events
---
# Event
Events are time-bound occurrences tied to projects, people, or periods.

View File

@ -0,0 +1,11 @@
---
type: Type
icon: chart-line-up
color: cyan
sidebar label: Measures
---
# Measure
Measures track the numbers that matter for a responsibility or project.

View File

@ -0,0 +1,11 @@
---
type: Type
icon: note
color: slate
sidebar label: Notes
---
# Note
Notes capture references, ideas, or QA artifacts that do not need a more specific type.

View File

@ -0,0 +1,11 @@
---
type: Type
icon: user
color: rose
sidebar label: People
---
# Person
People notes represent collaborators, owners, or recurring contacts.

View File

@ -0,0 +1,11 @@
---
type: Type
icon: checklist
color: violet
sidebar label: Procedures
---
# Procedure
Procedures describe repeatable workflows that support a responsibility.

View File

@ -0,0 +1,11 @@
---
type: Type
icon: rocket
color: blue
sidebar label: Projects
---
# Project
Projects are time-bound efforts with an owner, a status, and a clear outcome.

View File

@ -0,0 +1,11 @@
---
type: Type
icon: clock-countdown
color: emerald
sidebar label: Quarters
---
# Quarter
Quarter notes group the initiatives and outcomes for a planning window.

View File

@ -0,0 +1,11 @@
---
type: Type
icon: briefcase
color: green
sidebar label: Responsibilities
---
# Responsibility
Responsibilities are long-lived ownership areas with linked procedures and measures.

View File

@ -0,0 +1,11 @@
---
type: Type
icon: books
color: indigo
sidebar label: Topics
---
# Topic
Topics collect related notes and make search/navigation scenarios easy to inspect.

View File

@ -0,0 +1,9 @@
name: Active Projects
icon: rocket
color: blue
sort: "modified:desc"
filters:
all:
- field: type
op: equals
value: Project

View File

@ -0,0 +1,11 @@
---
type: Note
topics:
- "[[topic-writing]]"
status: Published
---
# Writing for Clarity vs. Writing for Credit
Write to be understood before you write to impress. This note exists so `Writing` has a strong prefix match underneath the exact title result.

View File

@ -0,0 +1,11 @@
---
type: Note
topics:
- "[[topic-writing]]"
status: Active
---
# Writing Weekly Rhythm
A short operational note about keeping a weekly publishing cadence without overproducing drafts.

View File

@ -0,0 +1,448 @@
{
"children": [
{
"type": "frame",
"id": "apEmpty",
"x": 0,
"y": 0,
"name": "Add Property — Inline Form (Empty State)",
"theme": { "Mode": "Light" },
"width": 320,
"height": 180,
"fill": "$--background",
"layout": "vertical",
"gap": 8,
"padding": 12,
"children": [
{
"type": "text",
"id": "apEmptyDesc",
"name": "description",
"fill": "$--muted-foreground",
"content": "Inline add-property form: replaces the old grey popup. Fields are horizontal, matching existing property row layout. Shows after clicking + Add property.",
"fontFamily": "Inter",
"fontSize": 11,
"fontWeight": "normal"
},
{
"type": "frame",
"id": "apEmptyExisting1",
"name": "Existing Property Row — Status",
"width": "fill_container",
"cornerRadius": 4,
"padding": [4, 6],
"alignItems": "center",
"children": [
{
"type": "text",
"id": "apEmptyLabel1",
"fill": "$--muted-foreground",
"content": "STATUS",
"fontFamily": "IBM Plex Mono",
"fontSize": 10,
"fontWeight": "500",
"letterSpacing": 1.2
},
{
"type": "frame",
"id": "apEmptyBadge1",
"fill": "$--accent-green-light",
"cornerRadius": 16,
"padding": [1, 6],
"children": [
{
"type": "text",
"id": "apEmptyBadgeText1",
"fill": "$--accent-green",
"content": "ACTIVE",
"fontFamily": "IBM Plex Mono",
"fontSize": 10,
"fontWeight": "600",
"letterSpacing": 1.2
}
]
}
]
},
{
"type": "frame",
"id": "apEmptySep",
"name": "Separator",
"width": "fill_container",
"height": 1,
"fill": "$--border"
},
{
"type": "frame",
"id": "apEmptyForm",
"name": "Inline Add Property Form — Empty",
"width": "fill_container",
"gap": 6,
"padding": [4, 6],
"alignItems": "center",
"children": [
{
"type": "frame",
"id": "apEmptyNameInput",
"name": "Name Input",
"width": 90,
"height": 26,
"fill": "$--muted",
"cornerRadius": 4,
"stroke": { "align": "inside", "thickness": 1, "fill": "$--border" },
"padding": [4, 6],
"alignItems": "center",
"children": [
{
"type": "text",
"id": "apEmptyNamePlaceholder",
"fill": "$--muted-foreground",
"content": "Name",
"fontFamily": "Inter",
"fontSize": 12,
"fontWeight": "normal"
}
]
},
{
"type": "frame",
"id": "apEmptyTypeSelect",
"name": "Type Selector",
"width": 72,
"height": 26,
"fill": "$--muted",
"cornerRadius": 4,
"stroke": { "align": "inside", "thickness": 1, "fill": "$--border" },
"padding": [4, 6],
"gap": 4,
"alignItems": "center",
"children": [
{
"type": "icon_font",
"id": "apEmptyTypeIcon",
"width": 12,
"height": 12,
"iconFontName": "type",
"iconFontFamily": "lucide",
"fill": "$--muted-foreground"
},
{
"type": "text",
"id": "apEmptyTypePlaceholder",
"fill": "$--muted-foreground",
"content": "Text",
"fontFamily": "Inter",
"fontSize": 12,
"fontWeight": "normal"
},
{
"type": "icon_font",
"id": "apEmptyTypeChevron",
"width": 10,
"height": 10,
"iconFontName": "chevron-down",
"iconFontFamily": "lucide",
"fill": "$--muted-foreground"
}
]
},
{
"type": "frame",
"id": "apEmptyValueInput",
"name": "Value Input",
"width": "fill_container",
"height": 26,
"fill": "$--muted",
"cornerRadius": 4,
"stroke": { "align": "inside", "thickness": 1, "fill": "$--border" },
"padding": [4, 6],
"alignItems": "center",
"children": [
{
"type": "text",
"id": "apEmptyValuePlaceholder",
"fill": "$--muted-foreground",
"content": "Value",
"fontFamily": "Inter",
"fontSize": 12,
"fontWeight": "normal"
}
]
},
{
"type": "frame",
"id": "apEmptyConfirmBtn",
"name": "Confirm Button",
"width": 24,
"height": 24,
"fill": "$--primary",
"cornerRadius": 4,
"justifyContent": "center",
"alignItems": "center",
"children": [
{
"type": "icon_font",
"id": "apEmptyConfirmIcon",
"width": 14,
"height": 14,
"iconFontName": "check",
"iconFontFamily": "lucide",
"fill": "#ffffff"
}
]
},
{
"type": "frame",
"id": "apEmptyCancelBtn",
"name": "Cancel Button",
"width": 24,
"height": 24,
"cornerRadius": 4,
"stroke": { "align": "inside", "thickness": 1, "fill": "$--border" },
"justifyContent": "center",
"alignItems": "center",
"children": [
{
"type": "icon_font",
"id": "apEmptyCancelIcon",
"width": 14,
"height": 14,
"iconFontName": "x",
"iconFontFamily": "lucide",
"fill": "$--muted-foreground"
}
]
}
]
}
]
},
{
"type": "frame",
"id": "apFilled",
"x": 400,
"y": 0,
"name": "Add Property — Inline Form (Filled State)",
"theme": { "Mode": "Light" },
"width": 320,
"height": 180,
"fill": "$--background",
"layout": "vertical",
"gap": 8,
"padding": 12,
"children": [
{
"type": "text",
"id": "apFilledDesc",
"name": "description",
"fill": "$--muted-foreground",
"content": "Filled state: user has typed a property name, selected a type (Date), and entered a value. Confirm button is enabled (blue). The form looks like the property row it will create.",
"fontFamily": "Inter",
"fontSize": 11,
"fontWeight": "normal"
},
{
"type": "frame",
"id": "apFilledExisting1",
"name": "Existing Property Row — Status",
"width": "fill_container",
"cornerRadius": 4,
"padding": [4, 6],
"alignItems": "center",
"children": [
{
"type": "text",
"id": "apFilledLabel1",
"fill": "$--muted-foreground",
"content": "STATUS",
"fontFamily": "IBM Plex Mono",
"fontSize": 10,
"fontWeight": "500",
"letterSpacing": 1.2
},
{
"type": "frame",
"id": "apFilledBadge1",
"fill": "$--accent-green-light",
"cornerRadius": 16,
"padding": [1, 6],
"children": [
{
"type": "text",
"id": "apFilledBadgeText1",
"fill": "$--accent-green",
"content": "ACTIVE",
"fontFamily": "IBM Plex Mono",
"fontSize": 10,
"fontWeight": "600",
"letterSpacing": 1.2
}
]
}
]
},
{
"type": "frame",
"id": "apFilledSep",
"name": "Separator",
"width": "fill_container",
"height": 1,
"fill": "$--border"
},
{
"type": "frame",
"id": "apFilledForm",
"name": "Inline Add Property Form — Filled",
"width": "fill_container",
"gap": 6,
"padding": [4, 6],
"alignItems": "center",
"children": [
{
"type": "frame",
"id": "apFilledNameInput",
"name": "Name Input (filled)",
"width": 90,
"height": 26,
"fill": "$--muted",
"cornerRadius": 4,
"stroke": { "align": "inside", "thickness": 1, "fill": "$--primary" },
"padding": [4, 6],
"alignItems": "center",
"children": [
{
"type": "text",
"id": "apFilledNameText",
"fill": "$--foreground",
"content": "deadline",
"fontFamily": "Inter",
"fontSize": 12,
"fontWeight": "normal"
}
]
},
{
"type": "frame",
"id": "apFilledTypeSelect",
"name": "Type Selector (Date selected)",
"width": 72,
"height": 26,
"fill": "$--muted",
"cornerRadius": 4,
"stroke": { "align": "inside", "thickness": 1, "fill": "$--border" },
"padding": [4, 6],
"gap": 4,
"alignItems": "center",
"children": [
{
"type": "icon_font",
"id": "apFilledTypeIcon",
"width": 12,
"height": 12,
"iconFontName": "calendar",
"iconFontFamily": "lucide",
"fill": "$--muted-foreground"
},
{
"type": "text",
"id": "apFilledTypeText",
"fill": "$--foreground",
"content": "Date",
"fontFamily": "Inter",
"fontSize": 12,
"fontWeight": "normal"
},
{
"type": "icon_font",
"id": "apFilledTypeChevron",
"width": 10,
"height": 10,
"iconFontName": "chevron-down",
"iconFontFamily": "lucide",
"fill": "$--muted-foreground"
}
]
},
{
"type": "frame",
"id": "apFilledValueInput",
"name": "Value Input (filled)",
"width": "fill_container",
"height": 26,
"fill": "$--muted",
"cornerRadius": 4,
"stroke": { "align": "inside", "thickness": 1, "fill": "$--primary" },
"padding": [4, 6],
"alignItems": "center",
"children": [
{
"type": "text",
"id": "apFilledValueText",
"fill": "$--foreground",
"content": "2026-03-15",
"fontFamily": "Inter",
"fontSize": 12,
"fontWeight": "normal"
}
]
},
{
"type": "frame",
"id": "apFilledConfirmBtn",
"name": "Confirm Button (enabled)",
"width": 24,
"height": 24,
"fill": "$--primary",
"cornerRadius": 4,
"justifyContent": "center",
"alignItems": "center",
"children": [
{
"type": "icon_font",
"id": "apFilledConfirmIcon",
"width": 14,
"height": 14,
"iconFontName": "check",
"iconFontFamily": "lucide",
"fill": "#ffffff"
}
]
},
{
"type": "frame",
"id": "apFilledCancelBtn",
"name": "Cancel Button",
"width": 24,
"height": 24,
"cornerRadius": 4,
"stroke": { "align": "inside", "thickness": 1, "fill": "$--border" },
"justifyContent": "center",
"alignItems": "center",
"children": [
{
"type": "icon_font",
"id": "apFilledCancelIcon",
"width": 14,
"height": 14,
"iconFontName": "x",
"iconFontFamily": "lucide",
"fill": "$--muted-foreground"
}
]
}
]
}
]
}
],
"variables": {
"--background": { "type": "color", "value": [{ "value": "#ffffff" }] },
"--foreground": { "type": "color", "value": [{ "value": "#37352F" }] },
"--muted": { "type": "color", "value": [{ "value": "#F0F0EF" }] },
"--muted-foreground": { "type": "color", "value": [{ "value": "#9B9A97" }] },
"--border": { "type": "color", "value": [{ "value": "#E9E9E7" }] },
"--primary": { "type": "color", "value": [{ "value": "#155DFF" }] },
"--accent-green": { "type": "color", "value": [{ "value": "#38A169" }] },
"--accent-green-light": { "type": "color", "value": [{ "value": "rgba(56, 161, 105, 0.1)" }] }
}
}

View File

@ -0,0 +1,340 @@
{
"children": [
{
"type": "frame",
"id": "ai_panel_closed",
"name": "AI Agent Panel — Closed (trigger button in toolbar)",
"x": 0,
"y": 0,
"width": 1280,
"height": 800,
"fill": "$--background",
"layout": "horizontal",
"theme": { "Mode": "Light" },
"children": [
{
"type": "rectangle",
"id": "ai_closed_editor",
"width": "fill_container",
"height": "fill_container",
"fill": "$--muted",
"cornerRadius": 4
},
{
"type": "frame",
"id": "ai_closed_toolbar",
"name": "Right Toolbar",
"layout": "vertical",
"width": 36,
"height": "fill_container",
"fill": "$--background",
"padding": [8, 4],
"gap": 4,
"children": [
{
"type": "frame",
"id": "ai_trigger_btn",
"name": "AI Trigger Button",
"width": 28,
"height": 28,
"cornerRadius": 6,
"fill": "$--muted",
"layout": "horizontal",
"padding": [6, 6],
"children": [
{
"type": "text",
"id": "ai_trigger_icon",
"content": "✦",
"fill": "$--muted-foreground",
"fontSize": 14
}
]
}
]
}
]
},
{
"type": "frame",
"id": "ai_panel_open_idle",
"name": "AI Agent Panel — Open, Idle (empty state)",
"x": 1320,
"y": 0,
"width": 1280,
"height": 800,
"fill": "$--background",
"layout": "horizontal",
"theme": { "Mode": "Light" },
"children": [
{
"type": "rectangle",
"id": "ai_open_editor",
"width": "fill_container",
"height": "fill_container",
"fill": "$--muted",
"cornerRadius": 4
},
{
"type": "frame",
"id": "ai_panel_sidebar",
"name": "AI Panel Sidebar",
"layout": "vertical",
"width": 320,
"height": "fill_container",
"fill": "$--background",
"children": [
{
"type": "frame",
"id": "ai_panel_header",
"name": "Panel Header",
"layout": "horizontal",
"width": "fill_container",
"height": 45,
"padding": [0, 12],
"gap": 8,
"children": [
{
"type": "text",
"id": "ai_header_label",
"content": "AI",
"fontSize": 13,
"fontWeight": "600",
"fill": "$--muted-foreground",
"width": "fill_container"
},
{
"type": "text",
"id": "ai_close_icon",
"content": "✕",
"fontSize": 12,
"fill": "$--muted-foreground"
}
]
},
{
"type": "frame",
"id": "ai_empty_state",
"name": "Empty State",
"layout": "vertical",
"width": "fill_container",
"height": "fill_container",
"padding": [24, 24],
"children": [
{
"type": "text",
"id": "ai_empty_hint",
"content": "Ask the AI agent to work on your vault…",
"fontSize": 13,
"fill": "$--muted-foreground",
"textAlign": "center",
"width": "fill_container"
}
]
},
{
"type": "frame",
"id": "ai_input_row",
"name": "Input Row",
"layout": "horizontal",
"width": "fill_container",
"padding": [8, 12],
"gap": 8,
"children": [
{
"type": "rectangle",
"id": "ai_input_field",
"width": "fill_container",
"height": 32,
"cornerRadius": 6,
"fill": "$--muted"
},
{
"type": "frame",
"id": "ai_send_btn",
"name": "Send Button",
"width": 28,
"height": 28,
"cornerRadius": 6,
"fill": "$--primary",
"layout": "horizontal",
"padding": [6, 6],
"children": [
{
"type": "text",
"id": "ai_send_icon",
"content": "→",
"fontSize": 12,
"fill": "$--primary-foreground"
}
]
}
]
}
]
}
]
},
{
"type": "frame",
"id": "ai_panel_active",
"name": "AI Agent Panel — Active (streaming, action cards visible)",
"x": 2640,
"y": 0,
"width": 1280,
"height": 800,
"fill": "$--background",
"layout": "horizontal",
"theme": { "Mode": "Light" },
"children": [
{
"type": "rectangle",
"id": "ai_active_editor",
"width": "fill_container",
"height": "fill_container",
"fill": "$--muted",
"cornerRadius": 4
},
{
"type": "frame",
"id": "ai_active_panel",
"name": "AI Panel — With Messages",
"layout": "vertical",
"width": 320,
"height": "fill_container",
"fill": "$--background",
"children": [
{
"type": "frame",
"id": "ai_active_header",
"name": "Panel Header",
"layout": "horizontal",
"width": "fill_container",
"height": 45,
"padding": [0, 12],
"gap": 8,
"children": [
{
"type": "text",
"id": "ai_active_label",
"content": "AI",
"fontSize": 13,
"fontWeight": "600",
"fill": "$--muted-foreground",
"width": "fill_container"
}
]
},
{
"type": "frame",
"id": "ai_message_thread",
"name": "Message Thread",
"layout": "vertical",
"width": "fill_container",
"height": "fill_container",
"padding": [12, 12],
"gap": 16,
"children": [
{
"type": "frame",
"id": "ai_user_msg",
"name": "User Message",
"layout": "vertical",
"width": "fill_container",
"gap": 4,
"children": [
{
"type": "text",
"content": "You",
"fontSize": 11,
"fontWeight": "600",
"fill": "$--muted-foreground"
},
{
"type": "text",
"content": "Crea una nota evento per la riunione con Marco domani",
"fontSize": 13,
"fill": "$--foreground",
"width": "fill_container"
}
]
},
{
"type": "frame",
"id": "ai_agent_msg",
"name": "Agent Message + Actions",
"layout": "vertical",
"width": "fill_container",
"gap": 8,
"children": [
{
"type": "frame",
"id": "ai_action_done",
"name": "Action Card — Done",
"layout": "horizontal",
"width": "fill_container",
"height": 28,
"padding": [0, 8],
"gap": 6,
"cornerRadius": 4,
"fill": "$--muted",
"children": [
{
"type": "text",
"content": "✓",
"fontSize": 12,
"fill": "$--primary"
},
{
"type": "text",
"content": "Loaded vault context",
"fontSize": 12,
"fill": "$--foreground",
"width": "fill_container"
}
]
},
{
"type": "frame",
"id": "ai_action_progress",
"name": "Action Card — In Progress",
"layout": "horizontal",
"width": "fill_container",
"height": 28,
"padding": [0, 8],
"gap": 6,
"cornerRadius": 4,
"fill": "$--muted",
"children": [
{
"type": "text",
"content": "◌",
"fontSize": 12,
"fill": "$--primary"
},
{
"type": "text",
"content": "Creating: 2026-03-01-meeting-marco.md",
"fontSize": 12,
"fill": "$--foreground",
"width": "fill_container"
}
]
},
{
"type": "text",
"content": "Ho creato la nota evento e linkato Marco come partecipante. La trovi già aperta in un nuovo tab.",
"fontSize": 13,
"fill": "$--foreground",
"width": "fill_container"
}
]
}
]
}
]
}
]
}
]
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
{"children":[],"variables":{}}

View File

@ -0,0 +1 @@
{"children":[],"variables":{}}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,96 @@
{
"children": [
{
"type": "frame",
"id": "build_number_status_bar",
"name": "Build Number — Status Bar",
"x": 0,
"y": 0,
"width": 1200,
"height": 36,
"fill": "$--background",
"layout": "horizontal",
"gap": 12,
"padding": [
0,
16
],
"theme": {
"Mode": "Light"
},
"children": [
{
"type": "text",
"id": "status_vault",
"content": "vault-name",
"fill": "$--muted-foreground",
"fontFamily": "Inter",
"fontSize": 12
},
{
"type": "text",
"id": "status_sep1",
"content": "|",
"fill": "$--border",
"fontFamily": "Inter",
"fontSize": 12
},
{
"type": "text",
"id": "status_build",
"content": "b223",
"fill": "$--muted-foreground",
"fontFamily": "Inter",
"fontSize": 12
},
{
"type": "text",
"id": "status_note",
"content": "← dynamic build number from package.json, replacing hardcoded v0.4.2",
"fill": "$--muted-foreground",
"fontFamily": "Inter",
"fontSize": 11,
"fontStyle": "italic"
}
]
},
{
"type": "frame",
"id": "build_number_fallback",
"name": "Build Number — Fallback (no build info)",
"x": 0,
"y": 60,
"width": 400,
"height": 36,
"fill": "$--background",
"layout": "horizontal",
"gap": 12,
"padding": [
0,
16
],
"theme": {
"Mode": "Light"
},
"children": [
{
"type": "text",
"id": "fallback_build",
"content": "b?",
"fill": "$--muted-foreground",
"fontFamily": "Inter",
"fontSize": 12
},
{
"type": "text",
"id": "fallback_note",
"content": "← shows b? when build number unavailable",
"fill": "$--muted-foreground",
"fontFamily": "Inter",
"fontSize": 11,
"fontStyle": "italic"
}
]
}
]
}

View File

@ -0,0 +1,387 @@
{
"children": [
{
"type": "frame",
"id": "cp_new_ev",
"name": "Command Palette — type \"new ev\" autocomplete",
"x": 0,
"y": 0,
"width": 620,
"height": "fit_content(500)",
"fill": "$--background",
"layout": "vertical",
"gap": 24,
"padding": [32, 32],
"theme": { "Mode": "Light" },
"children": [
{
"type": "text",
"id": "cp_new_title",
"content": "Command Palette — \"new ev\" autocomplete",
"fill": "$--foreground",
"fontFamily": "Inter",
"fontSize": 16,
"fontWeight": "600"
},
{
"type": "frame",
"id": "cp_new_dialog",
"name": "Palette Dialog",
"width": 520,
"height": "fit_content(440)",
"fill": "$--popover",
"layout": "vertical",
"cornerRadius": [12, 12, 12, 12],
"stroke": "$--border",
"strokeThickness": 1,
"children": [
{
"type": "frame",
"id": "cp_new_input_row",
"width": "fill_container",
"height": 48,
"padding": [0, 16],
"layout": "horizontal",
"verticalAlign": "center",
"stroke": "$--border",
"strokeSides": ["bottom"],
"strokeThickness": 1,
"children": [
{
"type": "text",
"id": "cp_new_query",
"content": "new ev",
"fill": "$--foreground",
"fontFamily": "Inter",
"fontSize": 15
}
]
},
{
"type": "frame",
"id": "cp_new_results",
"name": "Results",
"width": "fill_container",
"layout": "vertical",
"padding": [4, 0],
"children": [
{
"type": "text",
"id": "cp_new_group_label",
"content": "NOTE",
"fill": "$--muted-foreground",
"fontFamily": "Inter",
"fontSize": 11,
"fontWeight": "600",
"letterSpacing": 1,
"padding": [8, 16, 4, 16]
},
{
"type": "frame",
"id": "cp_new_row1",
"name": "New Event (selected)",
"width": "fill_container",
"height": 36,
"padding": [0, 12],
"layout": "horizontal",
"verticalAlign": "center",
"horizontalAlign": "spaceBetween",
"cornerRadius": [6, 6, 6, 6],
"fill": "$--accent",
"margin": [0, 4],
"children": [
{
"type": "text",
"id": "cp_new_row1_label",
"content": "New Event",
"fill": "$--foreground",
"fontFamily": "Inter",
"fontSize": 14
}
]
},
{
"type": "frame",
"id": "cp_new_row2",
"name": "New Event Log",
"width": "fill_container",
"height": 36,
"padding": [0, 12],
"layout": "horizontal",
"verticalAlign": "center",
"horizontalAlign": "spaceBetween",
"cornerRadius": [6, 6, 6, 6],
"margin": [0, 4],
"children": [
{
"type": "text",
"id": "cp_new_row2_label",
"content": "New Event Log",
"fill": "$--foreground",
"fontFamily": "Inter",
"fontSize": 14
}
]
},
{
"type": "frame",
"id": "cp_new_row3",
"name": "New Experiment",
"width": "fill_container",
"height": 36,
"padding": [0, 12],
"layout": "horizontal",
"verticalAlign": "center",
"horizontalAlign": "spaceBetween",
"cornerRadius": [6, 6, 6, 6],
"margin": [0, 4],
"children": [
{
"type": "text",
"id": "cp_new_row3_label",
"content": "New Experiment",
"fill": "$--foreground",
"fontFamily": "Inter",
"fontSize": 14
}
]
}
]
},
{
"type": "frame",
"id": "cp_new_footer",
"width": "fill_container",
"height": 32,
"padding": [0, 16],
"layout": "horizontal",
"verticalAlign": "center",
"gap": 16,
"stroke": "$--border",
"strokeSides": ["top"],
"strokeThickness": 1,
"children": [
{
"type": "text",
"id": "cp_new_hint1",
"content": "↑↓ navigate",
"fill": "$--muted-foreground",
"fontFamily": "Inter",
"fontSize": 11
},
{
"type": "text",
"id": "cp_new_hint2",
"content": "↵ select",
"fill": "$--muted-foreground",
"fontFamily": "Inter",
"fontSize": 11
},
{
"type": "text",
"id": "cp_new_hint3",
"content": "esc close",
"fill": "$--muted-foreground",
"fontFamily": "Inter",
"fontSize": 11
}
]
}
]
}
]
},
{
"type": "frame",
"id": "cp_list_pe",
"name": "Command Palette — type \"list pe\" autocomplete",
"x": 720,
"y": 0,
"width": 620,
"height": "fit_content(500)",
"fill": "$--background",
"layout": "vertical",
"gap": 24,
"padding": [32, 32],
"theme": { "Mode": "Light" },
"children": [
{
"type": "text",
"id": "cp_list_title",
"content": "Command Palette — \"list pe\" autocomplete",
"fill": "$--foreground",
"fontFamily": "Inter",
"fontSize": 16,
"fontWeight": "600"
},
{
"type": "frame",
"id": "cp_list_dialog",
"name": "Palette Dialog",
"width": 520,
"height": "fit_content(440)",
"fill": "$--popover",
"layout": "vertical",
"cornerRadius": [12, 12, 12, 12],
"stroke": "$--border",
"strokeThickness": 1,
"children": [
{
"type": "frame",
"id": "cp_list_input_row",
"width": "fill_container",
"height": 48,
"padding": [0, 16],
"layout": "horizontal",
"verticalAlign": "center",
"stroke": "$--border",
"strokeSides": ["bottom"],
"strokeThickness": 1,
"children": [
{
"type": "text",
"id": "cp_list_query",
"content": "list pe",
"fill": "$--foreground",
"fontFamily": "Inter",
"fontSize": 15
}
]
},
{
"type": "frame",
"id": "cp_list_results",
"name": "Results",
"width": "fill_container",
"layout": "vertical",
"padding": [4, 0],
"children": [
{
"type": "text",
"id": "cp_list_group_label",
"content": "NAVIGATION",
"fill": "$--muted-foreground",
"fontFamily": "Inter",
"fontSize": 11,
"fontWeight": "600",
"letterSpacing": 1,
"padding": [8, 16, 4, 16]
},
{
"type": "frame",
"id": "cp_list_row1",
"name": "List People (selected)",
"width": "fill_container",
"height": 36,
"padding": [0, 12],
"layout": "horizontal",
"verticalAlign": "center",
"horizontalAlign": "spaceBetween",
"cornerRadius": [6, 6, 6, 6],
"fill": "$--accent",
"margin": [0, 4],
"children": [
{
"type": "text",
"id": "cp_list_row1_label",
"content": "List People",
"fill": "$--foreground",
"fontFamily": "Inter",
"fontSize": 14
}
]
},
{
"type": "frame",
"id": "cp_list_row2",
"name": "List Procedures",
"width": "fill_container",
"height": 36,
"padding": [0, 12],
"layout": "horizontal",
"verticalAlign": "center",
"horizontalAlign": "spaceBetween",
"cornerRadius": [6, 6, 6, 6],
"margin": [0, 4],
"children": [
{
"type": "text",
"id": "cp_list_row2_label",
"content": "List Procedures",
"fill": "$--foreground",
"fontFamily": "Inter",
"fontSize": 14
}
]
},
{
"type": "frame",
"id": "cp_list_row3",
"name": "List Projects",
"width": "fill_container",
"height": 36,
"padding": [0, 12],
"layout": "horizontal",
"verticalAlign": "center",
"horizontalAlign": "spaceBetween",
"cornerRadius": [6, 6, 6, 6],
"margin": [0, 4],
"children": [
{
"type": "text",
"id": "cp_list_row3_label",
"content": "List Projects",
"fill": "$--foreground",
"fontFamily": "Inter",
"fontSize": 14
}
]
}
]
},
{
"type": "frame",
"id": "cp_list_footer",
"width": "fill_container",
"height": 32,
"padding": [0, 16],
"layout": "horizontal",
"verticalAlign": "center",
"gap": 16,
"stroke": "$--border",
"strokeSides": ["top"],
"strokeThickness": 1,
"children": [
{
"type": "text",
"id": "cp_list_hint1",
"content": "↑↓ navigate",
"fill": "$--muted-foreground",
"fontFamily": "Inter",
"fontSize": 11
},
{
"type": "text",
"id": "cp_list_hint2",
"content": "↵ select",
"fill": "$--muted-foreground",
"fontFamily": "Inter",
"fontSize": 11
},
{
"type": "text",
"id": "cp_list_hint3",
"content": "esc close",
"fill": "$--muted-foreground",
"fontFamily": "Inter",
"fontSize": 11
}
]
}
]
}
]
}
],
"variables": {}
}

View File

@ -0,0 +1,285 @@
{
"children": [
{
"type": "frame",
"id": "datePickerClosed",
"x": 0,
"y": 0,
"name": "Date Picker — closed state (showing formatted date as button)",
"width": 320,
"height": 40,
"fill": "#ffffff",
"gap": 8,
"padding": 6,
"alignItems": "center",
"children": [
{
"type": "text",
"id": "dateClosedLabel",
"name": "label",
"fill": "#6b7280",
"content": "deadline",
"fontFamily": "IBM Plex Mono",
"fontSize": 10,
"fontWeight": "normal",
"letterSpacing": 1.2,
"textTransform": "uppercase"
},
{
"type": "frame",
"id": "dateClosedButton",
"name": "date-button",
"width": "fill_container",
"justifyContent": "flex-end",
"alignItems": "center",
"gap": 4,
"children": [
{
"type": "text",
"id": "dateClosedIcon",
"name": "calendar-icon",
"fill": "#9ca3af",
"content": "📅",
"fontSize": 12
},
{
"type": "text",
"id": "dateClosedValue",
"name": "date-value",
"fill": "#374151",
"content": "Mar 31, 2026",
"fontFamily": "Inter",
"fontSize": 12,
"fontWeight": "normal"
}
]
}
]
},
{
"type": "frame",
"id": "datePickerOpen",
"x": 0,
"y": 160,
"name": "Date Picker — open state (calendar popup below button)",
"width": 320,
"height": 380,
"fill": "#ffffff",
"layout": "vertical",
"gap": 4,
"padding": 0,
"children": [
{
"type": "frame",
"id": "dateOpenRow",
"name": "property-row",
"width": "fill_container",
"height": 40,
"gap": 8,
"padding": 6,
"alignItems": "center",
"children": [
{
"type": "text",
"id": "dateOpenLabel",
"name": "label",
"fill": "#6b7280",
"content": "deadline",
"fontFamily": "IBM Plex Mono",
"fontSize": 10,
"fontWeight": "normal",
"letterSpacing": 1.2,
"textTransform": "uppercase"
},
{
"type": "frame",
"id": "dateOpenButton",
"name": "date-button-active",
"width": "fill_container",
"justifyContent": "flex-end",
"alignItems": "center",
"gap": 4,
"children": [
{
"type": "text",
"id": "dateOpenIcon",
"name": "calendar-icon",
"fill": "#6366f1",
"content": "📅",
"fontSize": 12
},
{
"type": "text",
"id": "dateOpenValue",
"name": "date-value",
"fill": "#111827",
"content": "Mar 31, 2026",
"fontFamily": "Inter",
"fontSize": 12,
"fontWeight": "600"
}
]
}
]
},
{
"type": "frame",
"id": "calendarPopup",
"name": "calendar-popup",
"width": 280,
"height": 320,
"fill": "#ffffff",
"layout": "vertical",
"cornerRadius": 8,
"padding": 12,
"gap": 8,
"stroke": {
"align": "outside",
"thickness": 1,
"fill": "#e5e7eb"
},
"children": [
{
"type": "frame",
"id": "calendarHeader",
"name": "calendar-header",
"width": "fill_container",
"height": 32,
"alignItems": "center",
"justifyContent": "space-between",
"children": [
{
"type": "text",
"id": "calPrevBtn",
"name": "prev-month",
"fill": "#6b7280",
"content": "◀",
"fontSize": 12
},
{
"type": "text",
"id": "calMonthYear",
"name": "month-year",
"fill": "#111827",
"content": "March 2026",
"fontFamily": "Inter",
"fontSize": 14,
"fontWeight": "600"
},
{
"type": "text",
"id": "calNextBtn",
"name": "next-month",
"fill": "#6b7280",
"content": "▶",
"fontSize": 12
}
]
},
{
"type": "frame",
"id": "calWeekdayRow",
"name": "weekday-headers",
"width": "fill_container",
"height": 24,
"alignItems": "center",
"justifyContent": "space-between",
"children": [
{ "type": "text", "id": "wd1", "fill": "#9ca3af", "content": "Su", "fontSize": 11, "fontFamily": "Inter", "fontWeight": "500" },
{ "type": "text", "id": "wd2", "fill": "#9ca3af", "content": "Mo", "fontSize": 11, "fontFamily": "Inter", "fontWeight": "500" },
{ "type": "text", "id": "wd3", "fill": "#9ca3af", "content": "Tu", "fontSize": 11, "fontFamily": "Inter", "fontWeight": "500" },
{ "type": "text", "id": "wd4", "fill": "#9ca3af", "content": "We", "fontSize": 11, "fontFamily": "Inter", "fontWeight": "500" },
{ "type": "text", "id": "wd5", "fill": "#9ca3af", "content": "Th", "fontSize": 11, "fontFamily": "Inter", "fontWeight": "500" },
{ "type": "text", "id": "wd6", "fill": "#9ca3af", "content": "Fr", "fontSize": 11, "fontFamily": "Inter", "fontWeight": "500" },
{ "type": "text", "id": "wd7", "fill": "#9ca3af", "content": "Sa", "fontSize": 11, "fontFamily": "Inter", "fontWeight": "500" }
]
},
{
"type": "frame",
"id": "calGrid",
"name": "calendar-grid",
"width": "fill_container",
"height": "fill_container",
"layout": "vertical",
"gap": 2,
"children": [
{
"type": "frame",
"id": "calRow1",
"name": "week-1",
"width": "fill_container",
"height": 32,
"alignItems": "center",
"justifyContent": "space-between",
"children": [
{ "type": "text", "id": "d1", "fill": "#d1d5db", "content": " ", "fontSize": 12, "fontFamily": "Inter" },
{ "type": "text", "id": "d2", "fill": "#d1d5db", "content": " ", "fontSize": 12, "fontFamily": "Inter" },
{ "type": "text", "id": "d3", "fill": "#d1d5db", "content": " ", "fontSize": 12, "fontFamily": "Inter" },
{ "type": "text", "id": "d4", "fill": "#d1d5db", "content": " ", "fontSize": 12, "fontFamily": "Inter" },
{ "type": "text", "id": "d5", "fill": "#d1d5db", "content": " ", "fontSize": 12, "fontFamily": "Inter" },
{ "type": "text", "id": "d6", "fill": "#d1d5db", "content": " ", "fontSize": 12, "fontFamily": "Inter" },
{ "type": "text", "id": "d7", "fill": "#374151", "content": "1", "fontSize": 12, "fontFamily": "Inter" }
]
},
{
"type": "frame",
"id": "calRow5",
"name": "week-5-selected",
"width": "fill_container",
"height": 32,
"alignItems": "center",
"justifyContent": "space-between",
"children": [
{ "type": "text", "id": "d29", "fill": "#374151", "content": "29", "fontSize": 12, "fontFamily": "Inter" },
{ "type": "text", "id": "d30", "fill": "#374151", "content": "30", "fontSize": 12, "fontFamily": "Inter" },
{
"type": "frame",
"id": "selectedDay",
"name": "selected-day-31",
"width": 28,
"height": 28,
"fill": "#111827",
"cornerRadius": 14,
"alignItems": "center",
"justifyContent": "center",
"children": [
{ "type": "text", "id": "d31", "fill": "#ffffff", "content": "31", "fontSize": 12, "fontFamily": "Inter", "fontWeight": "600" }
]
},
{ "type": "text", "id": "d32", "fill": "#d1d5db", "content": " ", "fontSize": 12, "fontFamily": "Inter" },
{ "type": "text", "id": "d33", "fill": "#d1d5db", "content": " ", "fontSize": 12, "fontFamily": "Inter" },
{ "type": "text", "id": "d34", "fill": "#d1d5db", "content": " ", "fontSize": 12, "fontFamily": "Inter" },
{ "type": "text", "id": "d35", "fill": "#d1d5db", "content": " ", "fontSize": 12, "fontFamily": "Inter" }
]
}
]
},
{
"type": "frame",
"id": "calFooter",
"name": "calendar-footer",
"width": "fill_container",
"height": 28,
"alignItems": "center",
"justifyContent": "flex-end",
"gap": 8,
"children": [
{
"type": "text",
"id": "calClearBtn",
"name": "clear-button",
"fill": "#6b7280",
"content": "Clear",
"fontFamily": "Inter",
"fontSize": 12,
"fontWeight": "500"
}
]
}
]
}
]
}
],
"variables": {}
}

13769
design/design-full-layouts.pen Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,78 @@
{
"children": [
{
"type": "frame",
"id": "drag_drop_idle",
"name": "Drag & Drop Images — Idle (no drag)",
"x": 0,
"y": 0,
"width": 900,
"height": 600,
"fill": "$--background",
"layout": "vertical",
"theme": { "Mode": "Light" },
"children": [
{
"type": "rectangle",
"id": "drag_idle_editor",
"width": "fill_container",
"height": "fill_container",
"fill": "$--background",
"cornerRadius": 0
}
]
},
{
"type": "frame",
"id": "drag_drop_active",
"name": "Drag & Drop Images — Drag Over (overlay shown)",
"x": 940,
"y": 0,
"width": 900,
"height": 600,
"fill": "$--background",
"layout": "vertical",
"theme": { "Mode": "Light" },
"children": [
{
"type": "frame",
"id": "drag_active_container",
"name": "Editor with Drag Overlay",
"layout": "vertical",
"width": "fill_container",
"height": "fill_container",
"children": [
{
"type": "rectangle",
"id": "drag_active_editor_bg",
"width": "fill_container",
"height": "fill_container",
"fill": "$--background"
},
{
"type": "frame",
"id": "drag_overlay",
"name": "Drop Overlay",
"width": "fill_container",
"height": "fill_container",
"layout": "vertical",
"fill": "rgba(0,0,0,0.4)",
"cornerRadius": 8,
"children": [
{
"type": "text",
"id": "drag_overlay_label",
"content": "Drop image to insert",
"fontSize": 18,
"fontWeight": "600",
"fill": "#ffffff",
"textAlign": "center"
}
]
}
]
}
]
}
]
}

View File

@ -0,0 +1,56 @@
{
"children": [
{
"type": "frame",
"id": "fpdn_before",
"name": "Property Dropdown Narrow — Before (clipped)",
"x": 0,
"y": 0,
"width": 280,
"height": 200,
"fill": "#1a1a1a",
"layout": "vertical",
"gap": 8,
"padding": 12,
"theme": "dark",
"children": [
{
"type": "text",
"id": "fpdn_before_label",
"content": "Bug: StatusDropdown clipped by overflow:hidden container at 200-280px panel width",
"fill": "#ff4444",
"fontFamily": "SF Pro Text",
"fontSize": 12,
"fontWeight": "regular",
"letterSpacing": 0
}
]
},
{
"type": "frame",
"id": "fpdn_after",
"name": "Property Dropdown Narrow — After (portal, no clip)",
"x": 320,
"y": 0,
"width": 280,
"height": 200,
"fill": "#1a1a1a",
"layout": "vertical",
"gap": 8,
"padding": 12,
"theme": "dark",
"children": [
{
"type": "text",
"id": "fpdn_after_label",
"content": "Fix: StatusDropdown + DisplayModeSelector use createPortal with fixed positioning — renders above overflow:hidden, visible at any panel width",
"fill": "#44bb44",
"fontFamily": "SF Pro Text",
"fontSize": 12,
"fontWeight": "regular",
"letterSpacing": 0
}
]
}
]
}

View File

@ -0,0 +1,381 @@
{
"children": [
{
"type": "frame",
"id": "welcome_screen",
"name": "Getting Started — Welcome Screen",
"x": 0,
"y": 0,
"width": 1440,
"height": 900,
"fill": "#F7F6F3",
"layout": "vertical",
"alignItems": "center",
"justifyContent": "center",
"gap": 0,
"theme": { "Mode": "Light" },
"children": [
{
"type": "frame",
"id": "welcome_card",
"name": "Welcome Card",
"width": 520,
"height": "fit_content",
"fill": "#FFFFFF",
"cornerRadius": [12, 12, 12, 12],
"layout": "vertical",
"alignItems": "center",
"gap": 24,
"padding": [48, 48, 48, 48],
"stroke": "#E9E9E7",
"strokeThickness": 1,
"children": [
{
"type": "frame",
"id": "welcome_icon_wrap",
"name": "Icon",
"width": 64,
"height": 64,
"fill": "#EBF4FF",
"cornerRadius": [16, 16, 16, 16],
"layout": "vertical",
"alignItems": "center",
"justifyContent": "center",
"children": [
{
"type": "text",
"id": "welcome_icon_text",
"content": "✦",
"fontSize": 28,
"fill": "#2383E2",
"fontFamily": "Inter"
}
]
},
{
"type": "frame",
"id": "welcome_text_group",
"name": "Text Group",
"layout": "vertical",
"alignItems": "center",
"gap": 8,
"width": "fill_container",
"children": [
{
"type": "text",
"id": "welcome_title",
"content": "Welcome to Laputa",
"fill": "#37352F",
"fontFamily": "Inter",
"fontSize": 28,
"fontWeight": "700",
"letterSpacing": -0.5,
"textAlign": "center"
},
{
"type": "text",
"id": "welcome_subtitle",
"content": "Wiki-linked knowledge management for deep thinkers.\nChoose how to get started.",
"fill": "#787774",
"fontFamily": "Inter",
"fontSize": 14,
"lineHeight": 1.6,
"textAlign": "center"
}
]
},
{
"type": "rectangle",
"id": "welcome_divider",
"width": "fill_container",
"height": 1,
"fill": "#E9E9E7"
},
{
"type": "frame",
"id": "welcome_actions",
"name": "Actions",
"layout": "vertical",
"gap": 12,
"width": "fill_container",
"children": [
{
"type": "frame",
"id": "btn_create_vault",
"name": "Create Getting Started Vault Button",
"width": "fill_container",
"height": 44,
"fill": "#2383E2",
"cornerRadius": [8, 8, 8, 8],
"layout": "horizontal",
"alignItems": "center",
"justifyContent": "center",
"gap": 8,
"children": [
{
"type": "text",
"id": "btn_create_icon",
"content": "",
"fill": "#FFFFFF",
"fontFamily": "Inter",
"fontSize": 16,
"fontWeight": "600"
},
{
"type": "text",
"id": "btn_create_label",
"content": "Create Getting Started vault",
"fill": "#FFFFFF",
"fontFamily": "Inter",
"fontSize": 14,
"fontWeight": "600"
}
]
},
{
"type": "frame",
"id": "btn_open_folder",
"name": "Open Existing Folder Button",
"width": "fill_container",
"height": 44,
"fill": "#FFFFFF",
"stroke": "#E9E9E7",
"strokeThickness": 1,
"cornerRadius": [8, 8, 8, 8],
"layout": "horizontal",
"alignItems": "center",
"justifyContent": "center",
"gap": 8,
"children": [
{
"type": "text",
"id": "btn_open_icon",
"content": "📂",
"fill": "#37352F",
"fontFamily": "Inter",
"fontSize": 14
},
{
"type": "text",
"id": "btn_open_label",
"content": "Open an existing folder",
"fill": "#37352F",
"fontFamily": "Inter",
"fontSize": 14,
"fontWeight": "500"
}
]
}
]
},
{
"type": "text",
"id": "welcome_hint",
"content": "The Getting Started vault will be created in ~/Documents/Laputa",
"fill": "#787774",
"fontFamily": "Inter",
"fontSize": 12,
"textAlign": "center"
}
]
}
]
},
{
"type": "frame",
"id": "vault_missing_screen",
"name": "Getting Started — Vault Missing Error",
"x": 1540,
"y": 0,
"width": 1440,
"height": 900,
"fill": "#F7F6F3",
"layout": "vertical",
"alignItems": "center",
"justifyContent": "center",
"gap": 0,
"theme": { "Mode": "Light" },
"children": [
{
"type": "frame",
"id": "missing_card",
"name": "Missing Vault Card",
"width": 520,
"height": "fit_content",
"fill": "#FFFFFF",
"cornerRadius": [12, 12, 12, 12],
"layout": "vertical",
"alignItems": "center",
"gap": 24,
"padding": [48, 48, 48, 48],
"stroke": "#E9E9E7",
"strokeThickness": 1,
"children": [
{
"type": "frame",
"id": "missing_icon_wrap",
"name": "Warning Icon",
"width": 64,
"height": 64,
"fill": "#FFF3E0",
"cornerRadius": [16, 16, 16, 16],
"layout": "vertical",
"alignItems": "center",
"justifyContent": "center",
"children": [
{
"type": "text",
"id": "missing_icon_text",
"content": "⚠",
"fontSize": 28,
"fill": "#E8890C",
"fontFamily": "Inter"
}
]
},
{
"type": "frame",
"id": "missing_text_group",
"name": "Text Group",
"layout": "vertical",
"alignItems": "center",
"gap": 8,
"width": "fill_container",
"children": [
{
"type": "text",
"id": "missing_title",
"content": "Vault not found",
"fill": "#37352F",
"fontFamily": "Inter",
"fontSize": 28,
"fontWeight": "700",
"letterSpacing": -0.5,
"textAlign": "center"
},
{
"type": "text",
"id": "missing_subtitle",
"content": "The vault folder could not be found on disk.\nIt may have been moved or deleted.",
"fill": "#787774",
"fontFamily": "Inter",
"fontSize": 14,
"lineHeight": 1.6,
"textAlign": "center"
}
]
},
{
"type": "frame",
"id": "missing_path_badge",
"name": "Path Badge",
"width": "fill_container",
"height": "fit_content",
"fill": "#F7F6F3",
"cornerRadius": [6, 6, 6, 6],
"layout": "horizontal",
"alignItems": "center",
"justifyContent": "center",
"padding": [8, 12, 8, 12],
"children": [
{
"type": "text",
"id": "missing_path_text",
"content": "~/Laputa",
"fill": "#787774",
"fontFamily": "SF Mono, monospace",
"fontSize": 12
}
]
},
{
"type": "rectangle",
"id": "missing_divider",
"width": "fill_container",
"height": 1,
"fill": "#E9E9E7"
},
{
"type": "frame",
"id": "missing_actions",
"name": "Actions",
"layout": "vertical",
"gap": 12,
"width": "fill_container",
"children": [
{
"type": "frame",
"id": "btn_recreate_vault",
"name": "Create Getting Started Vault Button",
"width": "fill_container",
"height": 44,
"fill": "#2383E2",
"cornerRadius": [8, 8, 8, 8],
"layout": "horizontal",
"alignItems": "center",
"justifyContent": "center",
"gap": 8,
"children": [
{
"type": "text",
"id": "btn_recreate_icon",
"content": "",
"fill": "#FFFFFF",
"fontFamily": "Inter",
"fontSize": 16,
"fontWeight": "600"
},
{
"type": "text",
"id": "btn_recreate_label",
"content": "Create Getting Started vault",
"fill": "#FFFFFF",
"fontFamily": "Inter",
"fontSize": 14,
"fontWeight": "600"
}
]
},
{
"type": "frame",
"id": "btn_choose_folder",
"name": "Choose Different Folder Button",
"width": "fill_container",
"height": 44,
"fill": "#FFFFFF",
"stroke": "#E9E9E7",
"strokeThickness": 1,
"cornerRadius": [8, 8, 8, 8],
"layout": "horizontal",
"alignItems": "center",
"justifyContent": "center",
"gap": 8,
"children": [
{
"type": "text",
"id": "btn_choose_icon",
"content": "📂",
"fill": "#37352F",
"fontFamily": "Inter",
"fontSize": 14
},
{
"type": "text",
"id": "btn_choose_label",
"content": "Choose a different folder",
"fill": "#37352F",
"fontFamily": "Inter",
"fontSize": 14,
"fontWeight": "500"
}
]
}
]
}
]
}
]
}
],
"variables": {}
}

View File

@ -0,0 +1 @@
{"children":[],"variables":{}}

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