The Cargo homepage feeds Plugin::URL, which hosts can show to users, so
the placeholder should be somewhere reachable rather than a github.com URL
that never existed.
This retires YOUR-USERNAME and YOUR-PLUGIN-NAME as canonical values, which
is the self-arming STALE mechanism working as designed: both were skipped
while they were part of HOMEPAGE and became live checks the moment they
were not. Both pass, since the whole URL was replaced.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
Carried back from Bari 206, where sixteen deferred hard errors had
accumulated unnoticed because nothing distinguished them from style
warnings in the build log.
Future-incompatibility warnings are rustc saying this code stops compiling
on some later release. Denying the group makes that a build failure the
day it appears rather than a surprise during an unrelated toolchain bump.
Every plugin cloned from this template inherits the guard.
Clippy and style lints stay warnings; only the future_incompatible group
is denied.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
Integrating into Bari 206 turned up a pattern that cannot match correctly
formatted source. Its CLAP_DESCRIPTION is long enough that rustfmt wraps
the assignment:
const CLAP_DESCRIPTION: Option<&'static str> =
Some("Multiband compressor/limiter (...)");
A site pattern spanning `const ... = Some("...")` never matches that, and
the fix is general rather than specific to this field: a site pattern
should be the narrowest fragment that is still distinctive, so formatting
decisions above it cannot break the check. Some("...") is unique enough
and lives on one line whatever rustfmt does with the rest.
Also stops appending a bare newline to STALE when nothing was retired,
which a no-op regeneration does on every run.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
Integrating this toolkit into Bari 206 surfaced two things the template
could not express, both of which would have produced wrong output.
**AUTHOR.** Cargo's authors entry names whoever wrote the plugin; VENDOR
is the organisation that ships it. Bari 206 separates them - "Mikkeli
Matlock" authored it, "Novoyuuparosk" vends it - while this template only
happened to work because its two placeholders were identical. AUTHOR is
now its own value defaulting to VENDOR, pinned in branding.conf only when
it actually differs so the file keeps showing that it derives.
**Site-directed rewriting.** That default is exactly what broke the
rename: with AUTHOR defaulting to VENDOR, both fields hold the same old
string, and a global value substitution cannot tell which occurrence
belongs to which. Renaming the vendor put the org name in the authors
field.
The site table already holds the old resolved literal for every site it
owns, and regeneration produces the new one, so rewriting by that pair is
unambiguous. brand-plugin.sh now does that first and falls back to value
substitution for everything the table does not enumerate - doc comments,
use sites in other modules, prose. The order matters and is load-bearing:
run the global pass first and it consumes the old literals, leaving the
precise pass nothing to match.
Verified on the ambiguous case: renaming with a distinct author now puts
the person in Cargo.toml's authors and the org in Plugin::VENDOR, where
the previous implementation put the org in both.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
The filter still named check-branding.sh at the repo root, a path that no
longer exists after the move — so a change to the branding toolkit would
not have triggered CI at all. Silent, and exactly the failure the toolkit
exists to prevent elsewhere.
'tools/**' also covers the deploy scripts that will land there.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
Move the branding toolkit into tools/, derive names from PLUGIN_NAME, and drive
the checker from a data table so the scripts are identical across plugins.
Three changes that only make sense together.
**tools/**. check-branding.sh, brand-plugin.sh and branding.conf were
accumulating in the repo root, and a deploy.sh/bat/ps1 set would land
there too. They now live in tools/ and resolve the repo root explicitly
rather than assuming their own directory is it, so they behave the same
however they are invoked.
**One name drives the rest.** branding.conf now derives the package name,
the Rust types and the display name from PLUGIN_NAME, each overridable.
Derivation-by-default removes a class of drift; the override matters
because the derivation is sometimes invalid — "206 Prototype" derives to
"206_prototype", which cargo rejects outright — and because PLUGIN_NAME is
cosmetic while the package name is structural. A display tweak should not
silently rename the crate, its bundle lookup, the CI command and the
lockfile. This template overrides three of them, which a real plugin
normally will not: its names are the template's own rather than derived
from a product name.
An overridden PKG that no longer matches the derivation is reported at
info level, never failed. The override is usually deliberate; a display
rename that forgot the package looks identical from here, and is not.
**The site table is data.** branding-sites.tsv lists every place a name
must appear and in what form; check-branding.sh iterates it instead of
carrying 29 check calls in shell. The scripts are now identical across
every plugin built from this template, with only the table and conf
differing — which matters because the template and codename-206 had
already diverged by two checks, so every sync was a shell merge.
brand-plugin.sh regenerates the rows it owns and preserves the rest, so a
hand-added row for a file this template does not ship survives a rename.
Custom rows are value-substituted like any other tracked file, so they
track the rename rather than going stale — the first cut excluded the
whole table from substitution and got that wrong.
brand-plugin.sh also gained an interactive mode: run it with no arguments
and it prompts for each value with the current one as the default, so
Enter keeps it and a run that answers nothing changes nothing. It only
engages when there is a terminal to ask at, so CI gets the usage message
and exit 2 rather than a hang.
Verified by applying a full rename to a sandboxed copy: 8 files rewritten,
29 owned rows regenerated, 1 custom row preserved and substituted, checker
green at 48/0/7, and the result compiles as bari_206.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
check-branding.sh could say what disagreed but not fix it, and its
canonical block lived in its own header — so renaming meant hand-editing
the checker, which is exactly the fragile step it exists to catch.
branding.conf now holds the identity once. Both scripts read it and
neither contains a branding literal anywhere, so a rename never has to
rewrite its own tooling.
brand-plugin.sh derives the package name and Rust types from the display
name, validates them against what Cargo actually accepts, rewrites every
tracked file longest-value-first (a short name can be a substring of a
longer one), appends the retired spellings to STALE, and finishes by
running the checker. A run that ends green is a rename that landed. Dry
run unless --apply.
It refuses three things worth refusing:
- Package names Cargo rejects — digit-leading (`206 Prototype` derives to
`206_prototype`), Rust keywords, built-in crate collisions. Verified
against cargo init rather than assumed.
- Moving CLAP_ID or VST3_CLASS_ID without --allow-identity-change. Hosts
key saved projects off those; changing either orphans every existing
session silently. The 16-byte class ID is *proposed*, never derived —
it is a fixed-width frozen identity, so the choice stays human.
- Development history in CLAP_DESCRIPTION. Hosts show it to users who
never knew the codename, so any retired name or the repo codename
appearing there is rejected.
The checker gains the other half of its job: asserting canonical values
are present where they belong, not only that retired ones are gone.
Absence alone would pass a rename to the *wrong* new spelling. New
positive assertions cover Cargo authors, Cargo.lock, the CI bundle
command and NOTICE — every one of which the recent Bari 206 rename had to
touch. Structural checks read their file locations from branding.conf so
a plugin whose params outgrow src/lib.rs can point them elsewhere.
Also fixes NOTICE naming the repo rather than the product, found by the
new assertion, and excludes branding.conf from the stale sweep — it lists
every retired spelling by definition, the same reason check-branding.sh
was already excluded.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
Adds the minimal check a plugin repo actually needs: does it still build,
and do the identity strings still agree.
Both feature sets are built rather than just the default, because the
`vst3` cfg gates are exactly the kind of thing that rots — a default build
never compiles the Vst3Plugin impl, so a break there would otherwise
surface only when someone tried to ship a VST3. The bundle step is
included for the same reason: `cargo build` never exercises the xtask
bundler, and bundler.toml drifting from the crate name is invisible until
you try to produce an artifact.
The branding check runs first because it needs no toolchain and finishes
in under a second, so a half-landed rename fails before a build is spent
on it.
Performance testing is deliberately absent. Realtime cost is only
meaningful against an audio deadline, and `Plugin::process()` cannot be
called from a test at all: `ProcessContext` requires a `&Transport`, whose
constructor and fields are `pub(crate)` to nih_plug, so no external crate
can implement the trait. A static lint for locks in the audio path was
considered and dropped — `lock` and `borrow` are ordinary identifiers, not
reserved words, so a substring search matches every occurrence of "block"
in DSP code while missing `println!`, `recv()` and `Condvar::wait()`,
which are the likelier offenders. `assert_process_allocs` remains the real
guarantee, and it only fires in a debug build inside a host.
Verified by running the exact step sequence as the gitea-runner user under
the service's environment.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
Apache-2.0 was the wrong declaration for two independent reasons.
Enabling the `vst3` feature links vst3-sys, which is GPLv3-or-later by its
own authors' choice — they describe their port as a derivative of
Steinberg's SDK that "was not made in isolation", so the obligation holds
regardless of any question about Steinberg's own rights. Gating the
feature kept the default build clean, but plugins built from this template
are intended to ship VST3, so GPL is where they land anyway. Declaring it
up front is more honest than deferring the decision to every clone.
Separately, parts of src/lib.rs derive from Robbert van der Helm's
NIH-plug cookiecutter template and its `gain` example, both ISC. ISC's one
condition is that its copyright and permission notice travel with all
copies, and this repo carried neither — a compliance gap that existed
regardless of the GPL question. ISC is GPL-compatible, so the notice is
retained in a new NOTICE file rather than superseded.
The `vst3` feature stays opt-in, but its rationale changes: it is no
longer about licence compliance, only about not pulling a sizeable
dependency into a CLAP-only build. The Cargo.toml comment said otherwise
and would have misled the next reader.
Also corrects the README's claim that you must "accept Steinberg's VST3
SDK licence". No SDK source is vendored or redistributed here, so there is
nothing to accept at build time. The real constraint is vst3-sys's GPLv3,
plus Steinberg's separate trademark in "VST" — a different regime from
copyright that no source licence resolves.
Copyright in the Irene <irene@novoyuuparosk.org> commits is held by the
repository owner (an agent identity), so no third-party agreement was
needed for this relicense.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
Extend the branding checker over descriptions and Rust type names, and fix
two bugs the tests for it exposed: a stale scan that silently passed
outside a git checkout, and a TODO count that broke once it reached zero.
The checker covered the identity strings a host sees, but not two other
kinds of template residue.
Descriptions: `Cargo.toml`'s `description` and `CLAP_DESCRIPTION` both
shipped as placeholders, and the latter surfaces in some host browsers.
Type names: `MyPlugin` and `PluginParams` appear at nine sites between
the struct definitions, the three trait impls, the two export macros and
the params field. Missing one is a compile error rather than silent drift,
so this is a convenience rather than a safety net - but naming the site
beats reading rustc, and the `Vst3Plugin` impl sits behind a cfg, so a
default build never reports it at all. Renaming the types is optional:
leave the canonical values alone and the checks stay green.
TODO markers are reported at a new informational level that never counts
toward pass/fail. They are legitimate while building, so failing on them
would just train you to ignore the run - but a finished plugin should not
quietly ship with five of them.
Two bugs surfaced while testing this:
- The stale scan drew its file list from `git ls-files`, which returns
nothing outside a checkout. In an exported tarball every stale spelling
was therefore reported absent - the section passed hardest exactly when
it could see least. It now falls back to `find` and says which source
it used.
- `grep -c` prints 0 and exits 1 when there are no matches, so the TODO
count's `|| echo 0` appended a second zero and produced an unparseable
value once a rename removed the last TODO.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
Make the template actually usable: it did not compile, its build docs
described output paths the bundler never produces, and its declared
licence conflicted with the artifact its default build emitted.
Also brings over codename-206's branding checker, extended so that
renaming — the first thing anyone does with a template — verifies itself.
Cargo.toml claims the pinned nih-plug rev makes builds reproducible, but
the rev only pins that one tree. Everything beneath it — roughly 200
crates.io dependencies — still resolved to whatever was newest at build
time, so two clones a week apart could compile different code.
A cdylib plugin is a final artifact rather than a library others depend
on, so the usual argument for leaving the lockfile out does not apply.
Checking it in also means CI builds exactly what was built locally.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
Adapted from musiikki/codename-206, where the same script guards a single
plugin. It matters more here: renaming is the first thing anyone does with
a template, and identity is duplicated across Cargo.toml, bundler.toml,
src/lib.rs and the docs with nothing keeping them in agreement. A
half-finished rename builds a bundle under one name while the docs and
deploy script look for another.
Changes from the codename-206 original:
- Checks for files this repo does not ship (deploy.ps1) report as `skip`
rather than FAIL, and start enforcing once the file appears.
- STALE ships pre-seeded with this template's own placeholders, and each
entry is skipped while it is still part of a canonical value. That makes
renaming self-checking: entries arm themselves as you change the value
they belong to, with no bookkeeping. Substring rather than equality,
because placeholders nest — "your-domain" lives inside the canonical
CLAP_ID.
- Covers identity this template carries that codename-206's did not:
VENDOR, EMAIL, the Cargo homepage feeding Plugin::URL, that the `env!`
indirection is still in place, and the README's bundle command.
- Asserts CLAP_ID is reverse-DNS safe. A stray capital or space there is
not a compile error, it is a silent identity change between machines.
Two placeholder spellings had to move to avoid false positives, since a
checker that cries wolf trains you to ignore it: bundler.toml's comment
contained the literal "Plugin Name", and the CLAP_ID TODO spelled the
placeholder a third way that matched neither the constant nor the STALE
list. The TODO now illustrates the form instead of repeating a placeholder.
.gitattributes pins *.sh to LF so core.autocrlf=true on Windows cannot
check the script out with a CRLF shebang that dash rejects.
Verified three ways: clean template passes, a partial rename names every
drifted file, and a complete rename passes and still compiles.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
Cargo.toml declared Apache-2.0 while the default build linked vst3-sys,
whose bindings are GPLv3 — so the artifact a fresh clone produced could
not legally be distributed under the licence the repo claimed. A template
should not hand that trap to every project cloned from it.
NIH-plug already anticipates this: its `vst3` feature exists, in upstream's
own words, "mostly for GPL-compliance reasons". Taking `default-features =
false` and re-exporting `vst3` as a local opt-in makes the default build
CLAP-only and genuinely Apache-2.0 clean, while `--features vst3` remains
one flag away for anyone who accepts GPLv3.
Gating the feature rather than relicensing keeps the decision with whoever
uses the template. Reversing it is a one-line default plus removing two
cfg attributes, where relicensing to GPLv3 now would commit every
downstream plugin to that choice.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
Two things in the build instructions were wrong rather than merely thin.
The stated output paths (`nih_plug_template.vst3`) are not what the
bundler produces: `cargo xtask bundle` names artifacts from the `name` key
in bundler.toml, so a fresh clone actually yields `Plugin Name.vst3`.
Anyone following the deploy steps verbatim would copy a path that does not
exist. The VST3 artifact is also a directory bundle, so the `cp` needed
`-r` to work at all.
The egui editor pulls in baseview and x11, whose build scripts abort on a
missing `gl.pc` with a pkg-config error that says nothing about this
project. Naming the packages up front turns a confusing first-build
failure into a one-line fix.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
The scaffold did not compile. src/lib.rs was written against an API that
does not exist at the pinned rev (f36931f):
- `impl Params` declared six methods that are not trait members
(`as_slice`, `param_by_id`, `param_by_name` and their `_mut` pairs) over
two types that appear nowhere in the crate (`AtomicParam`, `ParamId`).
The real trait is `unsafe trait Params` with one required method,
`param_map`, and is meant to be derived rather than hand-written.
- `type SysSysexMessage` misspells the associated type `SysExMessage`.
- `ChannelSamples` has no immutable `get`, so the passthrough loop's
`*frame.get_mut(ch).unwrap() = *frame.get(ch).unwrap()` could not resolve.
Replaced with `#[derive(Params)]` over an example gain parameter, so the
skeleton demonstrates the smoother and dB formatters a real plugin needs
instead of leaving an empty struct that teaches nothing. The passthrough
loop becomes an actual gain application for the same reason.
`editor()` is wired to a real `create_egui_editor` window in the same
change rather than a follow-up: nih_plug_egui was already a declared
dependency that nothing used, and the persisted `editor_state` field the
editor needs is part of the same params struct being rewritten here.
Splitting them would leave a commit whose params struct exists only to
serve an editor that is not there yet.
Verified against a local checkout of nih-plug at the pinned rev rather
than from memory, and confirmed by building.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn