zudo-text

検索したい単語を入力

いつでも検索バーを開ける

l-build

Rebuild the local app install for the thin-launcher architecture — ROOT core (zudotext.app) plus every debug LEAF stub. Use when user says 'build', 'l-build', 'demo builds', 'build debug apps', 'rebui...

Refresh the local app install in ONE command via scripts/rebuild-local-apps.sh (pnpm rebuild:local-apps). No per-app argument.

Under the thin-launcher model (#2280/#2285) ROOT (zudotext.app) holds the ONE shared core (Contents/Frameworks/libzudotext_core.dylib) that embeds the renderer and all backend logic; the LEAVES are KB-scale stubs that point at ROOT's core via a Contents/Resources/core-path sidecar. ROOT runs the full writing app — the LEAVES add the per-app identity and the thin-launcher resolution path.

[1/3] build ROOT     → scripts/build-root-thin.sh  (shared core cdylib + stub)
[2/3] install ROOT   → /Applications/zudotext.app   (move-aside + cp -R)
[3/3] stamp LEAVES   → ~/Applications/<name>.app    (skip with NO_LEAVES=1)

The one expensive step is [1/3], the ROOT core build (minutes). Stamping the LEAVES costs seconds per app, because each LEAF is only a stub + sidecar + re-sign.

Why LEAVES are stamped by default

Every LEAF's core-path sidecar points at ROOT's installed bundle, so a LEAF that is not re-stamped after a ROOT rebuild keeps running against whatever core it was stamped against — or dies with "shared core not found" if ROOT moved. Re-stamping them in the same run keeps the whole local install on one core, which is what "rebuild the local apps" is supposed to mean.

Skip them when you only care about ROOT and want the fastest install:

NO_LEAVES=1 pnpm rebuild:local-apps

Each LEAF binds to a cloud workspace via config.json v2 (epic #4204 D14 retired local workspace directories). Every entry in build-debug-apps.sh's APP_LIST carries its workspace id, so re-stamping rewrites the same binding and the LEAF keeps its content. A new entry with a blank id boots to onboarding until you mint a real workspace (pnpm generate <name> --genesis …) and fill its id into APP_LIST.

Why ROOT goes to /Applications (stable daily-driver path)

Each LEAF's core-path sidecar bakes ROOT's absolute path at stamp time, so the LEAVES must point at a stable location that survives cargo clean/rebuilds — NOT the volatile cargo-target bundle. rebuild-local-apps.sh installs ROOT to /Applications/zudotext.app and stamps every LEAF against it (it sets ZUDOTEXT_ROOT_APP=/Applications/zudotext.app for the inner build-debug-apps.sh). If ROOT is later moved or deleted, the LEAVES exit at launch with "shared core not found".

Available LEAF names

devmemo, zmoddev, ztcg — defined in scripts/build-debug-apps.sh APP_LIST as "name workspaceId" pairs (blank workspace id = unbound). There is no per-app workspace directory anymore; content comes from the bound cloud workspace. Stamping kills a running instance of that LEAF first, so save open work before running.

Instructions

  1. Run from the project root — no argument parsing, ignore any app name in $ARGUMENTS:

    pnpm rebuild:local-apps
  2. Fast path (reuse an already-built ROOT): if ROOT was just built this session (e.g. pnpm tauri:build already ran), skip the multi-minute recompile and only reinstall + re-stamp:

    SKIP_ROOT_BUILD=1 pnpm rebuild:local-apps
  3. Timeout: allow several minutes for the full run (the ROOT core build dominates); the SKIP_ROOT_BUILD=1 path is seconds plus a few seconds per LEAF, plus a one-time couple of minutes the first time it builds the stamp-leaf binary (cargo build --release --bin stamp-leaf).

  4. Report success/failure from the script's exit code and printed lines. Relay the git HEAD: <sha> <subject> line and the installed core: <timestamp> line — the cheapest proof that the just-merged code made it into the core ROOT runs — plus the per-app ✓ Stamped and installed ~/Applications/<name>.app lines.

Single-LEAF re-stamp (power use, not this skill)

To stamp ONE LEAF against an already-built+installed ROOT, call the primitive directly:

ZUDOTEXT_ROOT_APP=/Applications/zudotext.app bash scripts/build-debug-apps.sh devmemo

Common failure modes

  • ROOT bundle missing (with SKIP_ROOT_BUILD=1) — Error: ROOT bundle not found at …/release/bundle/macos/zudotext.app. Drop SKIP_ROOT_BUILD=1 so the script builds ROOT first (macOS only).

  • ROOT build / stamp-leaf build fails (e.g. a Rust compile error or linker error after a dependency change). set -euo pipefail fails loudly — read the cargo output and fix the cause; do not blindly retry.

  • A stamped LEAF dies at launch with "shared core not found" — the ROOT it points at was moved or deleted. Re-run this skill so ROOT is reinstalled at /Applications/zudotext.app and the LEAVES are re-stamped against it.

  • A stamped LEAF boots to onboarding — expected when its APP_LIST workspace id is blank. Bind it to a real workspace (pnpm generate <name> --workspace-id <id>) or complete onboarding in the app.

  • First launch renders blank / a tiny window when a thin LEAF replaces a same-named prior install — the new stub inherits the old app's ~/Library/WebKit/com.takazudo.<name> + NSUserDefaults (keyed on the shared CFBundleIdentifier); incompatible persisted UI state can blank the renderer on the first launch. It self-heals on the second launch. Pre-release-acceptable (old persisted UI state is re-creatable per the root CLAUDE.md). For a clean first launch, clear the stale state first: defaults delete com.takazudo.<name>; trash ~/Library/WebKit/com.takazudo.<name>.