---
name: syncing-daemon-release
description: Use when wavelength publishes a new release or revision and this repo must be updated to pair with it, when generated.ts / wallet.json / RUNTIME_MANIFEST_VERSION are stale, when gen:types or gen:api-docs fails or drifts, or when daemon-side RPC, facade type, CLI flag, or wasm asset changes need to land here.
metadata:
  internal: true
title: syncing-daemon-release
canonical_url: https://skilld.dev/gh/lightninglabs/wavelength-sdk/syncing-daemon-release
last_updated: 2026-11-01T19:15:52.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install lightninglabs/wavelength-sdk/syncing-daemon-release`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/syncing-daemon-release`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/lightninglabs/wavelength-sdk/syncing-daemon-release) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/syncing-daemon-release`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/syncing-daemon-release --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/syncing-daemon-release --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Syncing to a New wavelength Release

## Overview

One pinned daemon revision drives three committed artifacts that must move
together: the generated facade types (`packages/core/src/generated.ts`), the
API reference data (`apps/docs/src/data/api/wallet.json`), and the pin itself
(`RUNTIME_MANIFEST_VERSION` in `packages/core/src/version.ts`). The wasm
runtime asset set is gitignored and staged from the pin, not committed. A sync
is complete when the three match the same daemon commit and the verification
ladder passes.

All generators read the wavelength checkout at `../wavelength` or
`$WAVELENGTH_DIR`. There may be no directory literally named `wavelength`, so
find it by remote (`github.com/lightninglabs/wavelength` in `git remote -v`,
under any remote name), not by directory name. Do not move the shared checkout
to the target commit: it is often behind the remote and may have local edits,
so a fast-forward or stash disturbs someone else's working tree. Use a
throwaway worktree instead:

```sh
cd <daemon checkout> && git fetch <remote> --tags
# <target> is the release tag (v<X.Y.Z>) or, when preparing a sync ahead of
# the tag, the daemon commit SHA. rev-parse on an annotated tag returns the
# tag OBJECT hash, so always dereference with ^{commit}.
git worktree add --detach /tmp/wavelength-<version> '<target>^{commit}'
export WAVELENGTH_DIR=/tmp/wavelength-<version>            # absolute path
# ... run the whole sync ...
cd <daemon checkout> && git worktree remove --force /tmp/wavelength-<version>
```

## What changed upstream -> what to touch here

| Upstream change | Regenerate | Hand-update |
|---|---|---|
| Facade type fields (`sdk/wavewalletdk`) | `pnpm gen:types` | Consumers of renamed fields (`git grep <old_field>` across `packages/`, `apps/`). Every RPC verb is mapped once in `packages/core/src/base-client.ts`; transports supply only `callRaw`. `requests.ts`/`results.ts` stay hand-authored (see `docs/codegen.md`) |
| WalletService RPC added/removed | `pnpm gen:api-docs` | The RPC checklist below |
| RPC/field doc comments only | `pnpm gen:api-docs` | Nothing (pages render from wallet.json) |
| DaemonService RPCs/messages (`waverpc/daemon.proto`) | Nothing | wallet.json covers `WalletService` ONLY, so an empty wallet.json diff after a large daemon.proto change is expected, not a generator failure. It lands as CLI/prose docs work (step 4); `wavecli` is the DaemonService client, so check `cmd_*.go` |
| wavecli flags/commands | Nothing | The command's page in `apps/docs/src/content/docs/cli/`; a new top-level command also needs a `CLI_NAV` entry. A change to the GLOBAL flag set, the exit-code table, or the error envelope touches `cli.mdx` and potentially every command page: grep the whole `cli/` directory for the old flag spelling or exit code, not just the changed command's page. A REMOVED one must be deleted in lockstep: its `cli/<cmd>.mdx`, its `CLI_NAV` entry, its row in the `cli.mdx` table, and its slug in `apps/docs/tests/cli.spec.ts`'s hardcoded slug list (`git grep -n <cmd> apps/docs` finds stragglers) |
| Daemon operational facts (ports, TLS, build tags, gateway behavior) | Nothing | `apps/docs/src/content/docs/api/get-started.mdx` and `api/rest.mdx`; `cli.mdx` global flags/exit codes. Checks added to `waved/config.go` `Validate` also reach SDK users: `sdk/wavewalletdk/embedded.go` runs them at startup, so check `concepts/networks-and-config.mdx` too |
| Wasm runtime build | `wasm:local` (step 5) | Bump the pin first |
| Runtime asset FILE LIST | Nothing | Three places in lockstep: `packages/web/src/runtime-manifest.ts` (`RUNTIME_ASSET_FILES`, and in the same file, generated: `RUNTIME_ASSET_DIGESTS`), `apps/web-wallet-demo/scripts/wasm-local.sh`, `apps/web-wallet-demo/scripts/fetch-runtime-assets.sh`. A fourth lives upstream in wavelength's `mobile-bindings.yml`: its "Package browser WASM runtime" step lists the files packed into the release archive, so diff that step's list against the three local copies |
| Gomobile mobile bindings build | `bindings:local` (step 5) | Bump the pin first. Mirrors the wasm row: build from `$WAVELENGTH_DIR`, since the pin is often not downloadable yet. `bindings:fetch` works only once it names a published release |
| Gomobile facade (`sdk/wavewalletdk/mobile`) | Nothing | Native SDK docs checkpoint (below), AND both shipped transports. This package is NOT native-only: `cmd/wavewalletdk-wasm` builds with `-tags "mobile ..."` and dispatches every verb through it, so a change upstream calls mobile-only (a per-call deadline, a new request field, a stable error prefix) lands on the WEB transport too. Read the facade diff for behavior changes, not just types, and check whether a new request field is reachable from `packages/core`'s request types |

## RPC checklist

Adding or removing a WalletService RPC touches more places than any other
change class:

- **`packages/core`**: interface in `client.ts`, types in `requests.ts` /
  `results.ts`, impl in `base-client.ts` (one place; transports pipe
  `callRaw`), the barrel `index.ts`, and `testing/fake-client.ts` (it
  `implements WavelengthClient`, so a missing method fails typecheck).
- **Docs config**: `API_NAV` in `apps/docs/src/config/nav.ts` (it is there,
  below the SDK `NAV` array); `API_CLI`, `API_CLI_INVOCATION`, `API_SAMPLES`
  in `config/api.ts`; any new inline reference type in `config/api-links.ts`
  (`coreSymbols` + `inlineTypeOwners`), or its deep link will not resolve.
- **Reference prose**: only
  `apps/docs/src/content/docs/reference/wavelength-core.mdx`. The web and RN
  pages re-export core and carry no method list.
- **Docs tests hardcoding the method count**: `apps/docs/tests/nav.spec.ts`
  and `api-data.spec.ts` assert a literal, as both a numeral and an English
  word, so grep for both. `api-method.spec.ts` and `agent-artifacts.spec.ts`
  iterate every method, so the new page must build and be reachable.

## Ordered procedure

```sh
export WAVELENGTH_DIR=/absolute/path/to/wavelength   # a worktree at the
                                                     # release (see Overview)
```

1. **Pin**: set `RUNTIME_MANIFEST_VERSION` in `packages/core/src/version.ts`
   to the release tag (`v0.1.0`), or to the daemon short commit hash when
   preparing a sync ahead of the tag. Keep the exact single-quoted literal
   form; `scripts/runtime-version.mjs` parses the source text. A hash pin is
   the normal way to get a sync reviewed before the release exists: open the
   PR on the hash, then flip to the tag before merging. CI's `runtime-pin` job
   stays red until the pin names a published release, so expect it red for the
   whole review, and never merge it red.
2. **Types**: `pnpm gen:types` (needs Go + tygo). Review the generated.ts
   diff, then grep-and-fix hand-authored consumers per the table. Two upstream
   changes surface as generator problems, both fixed in `scripts/gen-types.mts`
   and never by hand-editing generated.ts:
   - A build failure `'any' only refers to a type` means the facade added an
     exported scalar const assigned from another package (e.g.
     `MaxSigningWorkers = waved.MaxSigningWorkers`); tygo cannot inline the
     value and emits `export const X = any /* ... */;`. gen-types strips such
     unresolved consts; extend that strip if a new shape slips through.
   - Em-dashes in upstream Go doc comments reach generated.ts verbatim.
     gen-types sanitizes them to hyphens, so if the em-dash check trips on
     generated.ts, the sanitizer regressed.
3. **API data**: `pnpm gen:api-docs`. Its gates fail loudly by design:
   - Nav drift: update `API_NAV` (and the curation maps in `config/api.ts`),
     then re-run. Never weaken the check.
   - Missing doc comments: the tag is immutable, so add the comments in the
     throwaway daemon worktree, regenerate, note it in the docs commit body,
     and raise an upstream fix in wallet.proto so the next release carries
     them. Never weaken the gate.
   - Run it twice; the second run must produce a byte-identical wallet.json.
   - Sample keys in `API_SAMPLES` must be real request field names (a spec
     enforces this).
4. **CLI/prose docs**: author from wavelength source
   (`cmd/wavecli/waveclicommands/cmd_*.go`: `Flags()` registrations with
   defaults, and which RPC the `RunE` calls), NEVER from `--help` output
   (build tags hide commands, and help text omits exit codes and JSON shapes).
   Every subcommand gets its own `###` section with its own flags table.
   Verify operational claims against `waved/config.go` and
   `gateway_server.go`. Behavior changes (refresh, boarding, swap timing)
   leave no trace in the type, proto, or CLI diffs, so also read the merged
   PR titles in the range (`git log --merges <old>..<new>`) and recheck any
   docs page that describes the changed behavior.
5. **Runtime assets**: check the release first (`gh release view <pin> --repo
   lightninglabs/wavelength --json isDraft,assets`). If it is published with
   assets attached, `pnpm --filter web-wallet-demo run wasm:fetch` and `pnpm
   --filter @lightninglabs/wavelength-react-native run bindings:fetch` are
   both correct and much faster than building, and they exercise the deploy's
   actual path. Fall back to the `:local` scripts only for a commit-SHA pin or
   a draft release.

   `pnpm --filter web-wallet-demo run wasm:local` builds from
   `$WAVELENGTH_DIR` into `public/runtime/<version>/` (bump the pin first or it
   stages under the OLD version). The deploy instead fetches
   `Wavewalletdk.wasm.tar.gz` from the release named by the pin. That archive
   lands on a DRAFT release and draft assets are not publicly downloadable, so
   a tag-shaped pin that `runtime-pin` still rejects usually means the release
   is unpublished, not that the pin is wrong. The other cause is a PUBLISHED
   release whose asset build failed: the binding assets are attached by a
   separate workflow, so `wasm:fetch` and `bindings:fetch` 404 while every
   other release asset is present. Before assuming a draft, list the assets and
   check that workflow's run on the tag (`gh run list --repo
   lightninglabs/wavelength --workflow mobile-bindings.yml`). Read the failed
   job's log: a build failure needs an upstream fix, not a re-run, so raise it
   with the user and continue with the `:local` scripts meanwhile. The RN
   transport's mobile bindings key off the same pin and need the same
   treatment: restage them with
   `pnpm --filter @lightninglabs/wavelength-react-native run bindings:local`,
   which builds the `.aar` and the `.xcframework` from the same
   `$WAVELENGTH_DIR` worktree (pass `android` or `ios` to build one platform;
   Android needs the SDK/NDK and a JDK, iOS needs macOS with Xcode). Both
   `:fetch` scripts build a release URL from the pin, so they 404 for a
   commit-SHA pin (no such release) and for a tag whose release is still a
   draft (assets not public). Nothing in CI covers the bindings, so a stale
   staging only shows up on a device build.

   After staging, run `pnpm gen:runtime-digests` so `RUNTIME_ASSET_DIGESTS` in
   `packages/web/src/runtime-manifest.ts` matches the newly staged set.
   Digests generated from a `wasm:local` build against a draft release are
   provisional: they are only confirmed correct once CI's `runtime-pin` job
   passes its digest check against the published release archive.
6. **Native SDK docs**: run the checkpoint below. It is cheap and usually a
   no-op, but nothing else in this procedure catches native-page drift.
7. **Versions + commits**: the packages version in lockstep with the daemon
   pin; set every `packages/*/package.json` version to the pinned release
   (without the `v`) so the release workflow's tag check passes. Commits use
   bare area prefixes (`core:`, `web:`, `docs:`, `demo:`), one logical change
   each, every commit building on its own.
8. **Publish**: create a DRAFT GitHub release tagged with the pin (e.g.
   `v0.2.0`), targeting main. Draft it as soon as the sync PR is up (drafts
   create no tag; the tag is minted at publish time from main's tip, so only
   publish after the merge). Check the pre-release box for any hyphenated
   version; release.yml refuses to publish a hyphenated tag without it, and
   the dist-tag follows (stable lands on `latest`, prerelease on `next`).
   Publishing triggers release.yml, which verifies the tag against the
   package versions and the pin, then publishes all four packages to npm.
   Nothing publishes until this release is cut. Full procedure and failure
   modes: RELEASE.md at the repo root.

   Release notes format: an intro line naming the paired wavelength release
   (linked), then for a prerelease an `npm install
   @lightninglabs/wavelength-web@next` snippet. Then the changes since the
   previous tag, grouped under `## SDK packages`, `## Docs site`, and
   `## Demo apps` headings (plus `## Maintenance` for repo plumbing), one
   bullet per merged PR in the GitHub auto-notes style:
   `* <concise change> by @<author> in <PR URL>`. Source the PR list from
   the auto-generated notes (gh api releases/generate-notes) so nothing is
   missed. For a stable (non-prerelease) release, pass the previous stable SDK
   tag as `previous_tag_name`, skipping intervening prerelease tags. Its notes
   and **Full Changelog** are cumulative across the whole release cycle (for
   example, `v0.1.1...v0.1.2`, not `v0.1.2-rc4...v0.1.2`). An RC compares
   against the immediately preceding published SDK tag. A PR whose content
   spans sections (e.g. a sync PR carrying both the pin and CLI docs) may
   appear once per section. End with the auto-notes' **Full Changelog** compare
   link using the same base tag.

## Verification ladder (run in this order)

```sh
pnpm build && pnpm typecheck        # build FIRST; typecheck resolves dist/*.d.ts
pnpm test:api-docs                  # extractor unit tests
pnpm --filter @lightninglabs/wavelength-web test
# Docs Playwright: its webServer has reuseExistingServer:true on port 4321, so
# it will silently attach to a stale preview from another worktree/session and
# serve an OLD build (a 404 for a brand-new page is almost always this, not a
# code bug). Pass a free PORT so it builds and serves THIS worktree fresh:
PORT=4399 pnpm --filter @lightninglabs/wavelength-docs test
WAVELENGTH_DIR=... pnpm --filter web-wallet-demo run wasm:local && \
  pnpm --filter web-wallet-demo run build:local && \
  pnpm --filter web-wallet-demo run test   # Playwright smoke test: gold standard
# build:local sets VITE_RUNTIME_INTEGRITY=off; locally built assets from
# wasm:local cannot match the pinned digests that plain `build` enforces.

# No em-dash, ever. `git grep -nP '\x{2014}'` fails on git builds without
# Unicode \x{} PCRE; this perl form is portable:
perl -CSD -ne 'print "$ARGV:$.\n" if /\x{2014}/' $(git ls-files packages apps scripts)
```

Also verify that a wallet created on the previous runtime still unlocks on
this one with the same identity, balance, and history. New database
migrations ship in most releases, and every check above starts from an empty
database.

A *deterministic* smoke-test failure is often a legitimate daemon behavior
change rather than a regression. Read the trace's page snapshot
(`test-results/.../error-context.md`) before assuming the wallet broke, then
move the assertion to the new behavior. Do not skip the test.

## Native SDK docs checkpoint (wavelength-mobile)

`apps/docs/src/content/docs/native-ios-android/` condenses the
wavelength-mobile repo. Find that checkout by a remote of
`lightninglabs/wavelength-mobile`; older clones may carry the pre-rename
`lightninglabs/damobile` URL, which GitHub redirects. Match the full path, not
a prefix, or `lightninglabs/wavelength` will match and land you on the daemon.

These pages track wavelength-mobile's published state, not the daemon tag, so
they never block a sync. After the main sync:

1. **Run the mini-pass every time**, even when `sdk/wavewalletdk/mobile` did
   not change: wavelength-mobile can rename types or rewrite its docs with no
   daemon release at all, so an unchanged facade is not evidence the pages are
   accurate. Each page opens with an MDX comment naming its upstream basis;
   diff its claims and snippets against that basis and confirm outbound links
   resolve. Three pages, and the quickstart's snippets are the only code.
2. If `sdk/wavewalletdk/mobile` changed in the range
   (`git -C $WAVELENGTH_DIR diff --stat <pin>..<target> -- sdk/wavewalletdk/mobile`)
   but wavelength-mobile has not adopted it yet, raise the follow-up with the
   user (this repo has no tracked TODO directory, so there is nowhere to file
   it silently) and finish the sync. The pages stay truthful meanwhile, since
   they describe the published wrapper and link out for volatile detail.

## Common mistakes

- Guessed package filters: the docs app is `@lightninglabs/wavelength-docs`,
  the web package is `@lightninglabs/wavelength-web`, the demo is
  `web-wallet-demo`.
- Hand-editing `apps/docs/src/data/api/wallet.json` or
  `packages/core/src/generated.ts`. Both are generated and committed.
- Documenting CLI flags from `--help` or memory instead of `cmd_*.go`.

## After the sync: improve this skill

Every release differs, so propose concrete edits to THIS file before
finishing, and apply them on approval. Propose an edit only if it passes both
tests: it applies to every sync run, not just releases that carry a certain
kind of change, and an agent would not reliably get it right unaided (the
mistake is silent, costly, or not discoverable from the code, the release, or a
failing check). Anything that a typecheck, a test, or a grep would surface is
left out. Correct stale instructions rather than noting them, prune what the run proved obsolete, keep additions terse (name the file,
the symptom, the fix), and propose the diff rather than committing it.
