Files
Lyrebird/docs/DEVELOPMENT_AND_RELEASE.md
T
josh 2c20b02e59 docs: consumer migration guide for Lyrebird 1.x → 2.0
Mirror of the dev-repo docs commit: add docs/migrating-to-2.0.md (module
rename + @UIParam/UIParamNode move into core LyrebirdSynth, with the fix)
and the cross-reference from DEVELOPMENT_AND_RELEASE.md. Docs-only; will be
reconciled by the next full release sync.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-23 21:21:45 -07:00

195 lines
8.3 KiB
Markdown

# Development & Release Workflow
How Lyrebird is developed, dogfooded, and released. Two git remotes with
different roles, two consumer projects with different linkage paths, and a
defined promotion path between them.
---
## Two remotes, two roles
| Remote | Role | Cadence |
|---|---|---|
| **Bitbucket** (`origin`) | Active development — fine-grained commits, experiments, in-progress branches, frequent pushes. | Continuous. Whatever your working rhythm is. |
| **Gitea** (`realizedsound.mooo.com/josh/Lyrebird`) | Release / distribution — the repo external consumers pull as a SwiftPM dependency. | Deliberate. Only when a coherent set of features is ready. |
The two are **not** mirrors. Bitbucket holds the full granular history; Gitea
receives **consolidated** promotions when a feature set is release-ready.
### Promoting from Bitbucket to Gitea
When development on Bitbucket reaches a point where the new work is ready for
consumers:
1. Make sure Bitbucket `main` is green — `swift test --no-parallel`, LiveCompile
`(cd LiveCompile && swift test --no-parallel)`, and a consumer smoke test
(below).
2. Decide the version bump (see **Versioning**). Update
`Sources/LyrebirdCLI/Version.swift` to match.
3. Run `/lyrebird_review` and resolve any blocking findings.
4. Push to Gitea as a single consolidated step. Two options:
- **Squash-merge** the development range into one release commit, then push
that commit to Gitea `main`. Keeps Gitea history coarse and readable.
- **Fast-forward** the whole range if you want Gitea to carry the same
history as Bitbucket. (Coarser is usually better for a distribution repo.)
5. Tag the release on Gitea and push the tag:
```bash
git tag -a vX.Y.Z -m "Lyrebird X.Y.Z — <summary>"
git push <gitea> main
git push <gitea> vX.Y.Z
```
Consumers pin a version range (`from: "X.Y.Z"`), so nothing they have breaks
until they choose to resolve to a newer tag. Bitbucket churn never reaches them.
> The remotes can have **different commit SHAs** for the same content (e.g. a
> squashed release commit). That's expected — consumers resolve by **tag**, not
> by SHA, so the SHA divergence is invisible to them.
---
## Two consumer projects, two linkage paths
These exercise the two ways someone depends on Lyrebird. Keep both working.
### Quartet — local-path dogfood (the robust example)
`/Users/josh/Documents/CurrentMusic/Quartet` depends on Lyrebird via a
**local-path** SwiftPM reference (`XCLocalSwiftPackageReference` →
`/Users/josh/Documents/LyrebirdII`), so it tracks your **working tree live** —
no push, no tag, no resolve. Edit Lyrebird, ⌘B Quartet, hear the change. This is
the fast real-world feedback loop.
- Quartet source uses `import LyrebirdSynth` + `import LyrebirdUI`.
- Whatever branch `/Users/josh/Documents/LyrebirdII` is checked out to is what
Quartet builds against. Keep it on the branch whose API Quartet expects
(normally `main`).
- Because it links the **static** `Lyrebird` product, Quartet needs no
`disable-library-validation` for the *library itself* — but Quartet enables
App Sandbox + Hardened Runtime for its own reasons and carries a
`Quartet.entitlements`. (Left in place; harmless.)
### Test — remote consumer simulation (the stranger's view)
`/Users/josh/Desktop/Test` depends on Lyrebird via the **remote Gitea URL**
(`XCRemoteSwiftPackageReference`), pinned to a version. This mimics exactly what
an external user gets: resolve from Gitea, link the published product.
- Use Test to validate that a **fresh pull builds with zero manual build
settings**. If Test needs a workaround, an external consumer would too — that
is a release bug, not a Test bug.
- After promoting to Gitea, bump Test's pin (or **File ▸ Packages ▸ Update to
Latest Package Versions**) and confirm a clean build.
### Consumer smoke test (CI-style, no Xcode)
Before any Gitea promotion, sanity-check that an external SPM consumer links the
static product cleanly:
```bash
cd /tmp && rm -rf consumer-sim && mkdir consumer-sim && cd consumer-sim
mkdir -p Sources/ConsumerSim
cat > Package.swift <<'PKG'
// swift-tools-version: 6.0
import PackageDescription
let package = Package(
name: "ConsumerSim",
platforms: [.macOS(.v15)],
dependencies: [ .package(name: "Lyrebird", path: "/Users/josh/Documents/LyrebirdII") ],
targets: [ .executableTarget(name: "ConsumerSim", dependencies: [
.product(name: "Lyrebird", package: "Lyrebird"),
.product(name: "LyrebirdUI", package: "Lyrebird"),
]) ]
)
PKG
cat > Sources/ConsumerSim/main.swift <<'SRC'
import Foundation
import LyrebirdSynth
import LyrebirdUI
let engine = SynthesisEngine(blockSize: 512, sampleRate: 48_000,
numOutputChannels: 2, numInputChannels: 0,
driver: NRTDriver(outputURL: URL(fileURLWithPath: "/tmp/cs.caf"), duration: 0.1))
final class Tone: SynthesizerBase { override func build() { output(bus: 0, source: OscSin.Audio(freq: 440) * 0.2) } }
do { try engine.add(Tone()); try engine.start(); print("CONSUMER-SIM OK") } catch { print("ERR \(error)") }
SRC
swift run # expect: CONSUMER-SIM OK
ls .build/debug/*.dylib 2>/dev/null | grep -i lyrebird && echo "WARN: dylib present" || echo "static link OK"
```
`CONSUMER-SIM OK` + no Lyrebird dylib = the package is consumer-clean.
---
## Linkage model — why two products
`Package.swift` vends the same `LyrebirdSynth` target through **two** products:
| Product | Linkage | Audience |
|---|---|---|
| `Lyrebird` | automatic → **static** | External consumers + Quartet + Test. No dynamic framework → immune to the Xcode 26 `PackageFrameworks/*.framework` regression → **zero build-setting workarounds**. |
| `LyrebirdDynamic` | `.dynamic` | **Internal only.** Consumed by the nested `LiveCompile/` sub-package, which needs a single shared `libLyrebirdDynamic.dylib` so the host and each live-compiled snippet dylib resolve to one copy of every class (the Phase 167 ObjC double-registration fix). |
The product name `Lyrebird` deliberately differs from the target/module name
`LyrebirdSynth`. A forced-`.dynamic` product cannot share a name with its target
when a downstream graph also static-links it, so the rename + two-product split
is what lets consumers stay static while LiveCompile stays dynamic.
**Rule:** never point an external consumer (or Quartet, or Test) at
`LyrebirdDynamic`. Only `LiveCompile/Package.swift` references it.
### The demo workspace & AUv3 are the exception
`Lyrebird.xcworkspace` (the six bundled demos) and the AUv3 sample link the
**dynamic** path for live-coding, so *those* projects carry the
`disable-library-validation` entitlement and the `SWIFT_USE_INTEGRATED_DRIVER=NO`
/ `parallelizeBuildables=NO` settings. That is internal-developer scaffolding,
**not** something external consumers inherit. (See
`MEMORY → project_dynamic_library_workaround.md`.)
---
## Versioning
SwiftPM resolves by **git tag** (semver) — there is no version field in
`Package.swift`. `Sources/LyrebirdCLI/Version.swift` carries a display string
that should be kept in sync with the tag.
- **Patch** (`X.Y.Z+1`) — bug fixes, no API change.
- **Minor** (`X.Y+1.0`) — additive: new Generators, new public API, no breakage.
- **Major** (`X+1.0.0`) — source-breaking change (renamed/removed public symbol,
changed signatures, **module rename**).
Tag format: `vX.Y.Z` (the `v` is conventional; SwiftPM strips it).
> Note: the `Lyrebird` → `LyrebirdSynth` **module** rename was source-breaking
> (`import Lyrebird` → `import LyrebirdSynth`). Because 1.0.0 was never
> distributed before the rename, it shipped *as* 1.0.0. A comparable rename
> after a public release would be a major bump.
>
> The consumer-facing 1.x → 2.0 upgrade steps (the module rename plus the
> `@UIParam` / `UIParamNode` move into the core module) are in
> `docs/migrating-to-2.0.md`.
---
## Quick reference
```bash
# Local dev (Bitbucket)
git push origin <branch> # frequent, granular
# Pre-release gate
swift test --no-parallel # core
(cd LiveCompile && swift test --no-parallel) # live-compile
# + consumer smoke test above
/lyrebird_review # blocking findings must clear
# Promote to Gitea (release)
# - bump Version.swift
# - squash/ff to a release commit
git push <gitea> main
git tag -a vX.Y.Z -m "..." && git push <gitea> vX.Y.Z
# Consumers then resolve the new tag at their leisure.
```