Skip to content

Sub E: Add-effect issue template + CONTRIBUTING + scaffolder - #14

Merged
yuichkun merged 7 commits into
mainfrom
feature/sub-e
Apr 15, 2026
Merged

Sub E: Add-effect issue template + CONTRIBUTING + scaffolder#14
yuichkun merged 7 commits into
mainfrom
feature/sub-e

Conversation

@yuichkun

Copy link
Copy Markdown
Owner

Summary

Encodes the "add a new effect" workflow that Sub D proved into three artifacts so future effects can be landed by worker AIs without asking for DSP/architectural clarifications.

  • .github/ISSUE_TEMPLATE/add-effect.yml — GitHub issue form with required fields (name, summary, category, reference + license, parameters, ≥3 presets, channel model, tolerance, edge cases) + optional "Class name override" for acronymed effects.
  • scripts/gen-effect.mjs — one-command scaffolder (vp run gen:effect <name> [--class <Pascal>] [--force]) that writes 5 new files (Rust kernel, TS class, catalog page, Tier2 test, Tier3a spec) and patches 5 sentinel markers in pre-existing files (effects/mod.rs, effects/index.ts, examples/main.ts, worklet/processor.ts, gen-golden/effects.py). Templates mirror Sub D's Gain 1:1, including the renderEffectPage() helper and test.fixme(...) for Tier3a (stays red until a real spec replaces it).
  • scripts/gen-effect.test.mjs — 13 self-tests covering valid/invalid names, --class override, --force, missing markers, and patch idempotency. Wired into CI via vp run test:scaffolder in the wasm-build job.
  • CONTRIBUTING.md — rewritten around an 8-step worker workflow, reference allow-list (interim placeholder until Sub F), common pitfalls (renderEffectPage lifecycle, alloc/dealloc size discipline, state-first ABI, PascalCase acronym → --class flag).

Scope changes vs. Issue #6

Per discussion before implementation, issue #6 body was updated as the SSoT before any code landed. Dropped from scope:

  • MANIFEST.toml + manifest-update.yml — no downstream consumer exists; deferred until a real reader (README generator, drift-detection CI, etc.) lands.
  • .github/ISSUE_TEMPLATE/config.yml — Discussions not enabled.
  • Toy-effect (invert-phase) dry-run PR — the next real-effect issue will exercise the template end-to-end.

Links

Definition of done

  • Add-effect issue form exists with all required fields
  • scripts/gen-effect.mjs handles happy path + --class + --force + invalid names + missing markers
  • scripts/gen-effect.test.mjs runs in CI (13/13 pass locally)
  • CONTRIBUTING.md rewritten per §6.4 of the updated issue body
  • Markers inserted into the 5 pre-existing files
  • Root package.json has gen:effect + test:scaffolder
  • CI runs test:scaffolder
  • vp check / vp run smoke / vp run test:tier2 / vp run test:scaffolder all green locally
  • vp run test:tier3a green in CI (not run locally — Playwright is slow)

Preview

Vercel preview should attach on push; the catalog is unchanged from Sub D so the preview is primarily a sanity check that the existing effects (passthrough, gain) still render.

Test plan

  • CI green across all jobs
  • After merge, run vp run gen:effect <some-effect> on a branch to confirm the scaffolder produces files that match CONTRIBUTING.md §3's expectations

yuichkun and others added 5 commits April 15, 2026 01:58
Adds // SCAFFOLDER:INSERT_MOD / _EXPORT / _PAGE / _DISPATCH and
# SCAFFOLDER:INSERT_REGISTRY marker comments at the insertion points
the gen-effect.mjs scaffolder patches against. No runtime behavior
change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
One-command scaffolder that generates the 5 per-effect files (Rust
kernel, TS class, catalog page, Tier2 test, Tier3a spec) and patches
5 sentinel markers in pre-existing files. Templates mirror Sub D's
Gain artifacts 1:1, including the renderEffectPage helper pattern for
catalog pages and test.fixme for Tier3a stubs (so CI signals red until
a real spec replaces it).

CLI supports --class <PascalName> for effects with audio acronyms
(EQ3Band, FFTWindow, LFO) whose naive kebab→Pascal split would produce
Eq3Band / FftWindow / Lfo.

scripts/gen-effect.test.mjs covers valid/invalid names, --class
override, --force overwrite, missing markers, and patch idempotency
against a tmp root; 13/13 pass under `node --test`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
YAML issue form that forces every new-effect request to declare the
spec in machine-readable form before submission: effect name, summary,
category, reference source + license, parameter list, preset list
(≥3), channel model, null-test tolerance, edge cases. Optional "Class
name override" field pairs with the scaffolder's --class flag for
acronymed effects. Closing markdown block codifies the 8-step worker
AI workflow inline.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Repositions CONTRIBUTING.md from maintainer-oriented Vercel setup
notes to contributor-facing onboarding. Sections: Ways to contribute,
Reference source allow-list (interim placeholder until Sub F lands
LICENSE-THIRDPARTY), the 8-step workflow a worker AI follows to land
an effect, Common pitfalls (renderEffectPage lifecycle, AudioParam
length handling, alloc/dealloc size discipline, state-first ABI,
PascalCase acronyms), Review expectations, Commit conventions. Vercel
maintainer notes preserved at the bottom as §7.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds two root scripts: `gen:effect` (invokes the scaffolder) and
`test:scaffolder` (runs the self-test under node --test). CI's
wasm-build job picks up `vp run test:scaffolder` so marker drift or
template regressions fail the build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
den Ready Ready Preview, Comment Apr 14, 2026 5:25pm

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 957184165c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/gen-effect.mjs Outdated
Comment on lines +55 to +56
if (!/^[a-z][a-z0-9-]*$/.test(name))
fail(2, `name must match /^[a-z][a-z0-9-]*$/, got "${name}"`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Tighten effect-name validation to disallow empty segments

The name regex currently accepts values like foo--bar and foo-, but deriveNames() then splits on - and unconditionally calls s[0].toUpperCase(), which crashes with TypeError for empty segments. In CLI mode this bypasses the intended ScaffoldError path and hard-crashes the scaffolder (node scripts/gen-effect.mjs foo--bar). Please reject empty kebab segments during validation (or guard the PascalCase conversion) so invalid names fail cleanly with exit code 2.

Useful? React with 👍 / 👎.

The prior regex /^[a-z][a-z0-9-]*$/ accepted `foo--bar`, `foo-`, and
`-foo`, which then tripped `deriveNames()`'s `s.split("-").map(s =>
s[0].toUpperCase() + s.slice(1))` at the empty segment — `undefined`
has no `.toUpperCase()`, surfacing as a raw TypeError that bypasses
ScaffoldError and the intended exit 2 path.

Tightens the pattern to require at least one [a-z0-9] in each
hyphen-delimited segment. Adds a regression test covering the five
shapes that used to crash.

Reported by @codex on #14.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@yuichkun

Copy link
Copy Markdown
Owner Author

@codex review

Addressed the empty-segment validation bug in 66831db:

  • Tightened the name regex to /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/ so each hyphen-delimited segment must be non-empty.
  • Added a regression test covering foo--bar, foo-, -foo, a--, a---b.

vp run test:scaffolder now 14/14 pass locally.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 66831db0da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/gen-effect.mjs
Comment thread .github/ISSUE_TEMPLATE/add-effect.yml Outdated
Two codex findings on 66831db:

P2: `snake` is interpolated verbatim into `pub mod <snake>;` (Rust)
and `import * as <snake> from ...` (TS). A name like `for` passes the
kebab regex but lands as `import * as for ...` and breaks the whole
tree. Blocks the known reserved-identifier set (Rust keywords + TS/JS
reserved words that are all lowercase and thus reachable through the
regex) up front with exit 2.

P3: the add-effect.yml `Effect name` field still documented the old
`/^[a-z][a-z0-9-]*$/`. Updates the description to the current
non-empty-segment regex and calls out the reserved-ident constraint
so contributors don't file issues with names the scaffolder would
refuse.

Adds a regression test covering ten reserved names.

Reported by @codex on #14.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@yuichkun

Copy link
Copy Markdown
Owner Author

@codex review

Addressed both findings on 66831db in f6d719c:

P2 (reserved idents): Added a RESERVED_IDENTS set covering Rust keywords (including reserved-for-future-use) + lowercase TS/JS reserved words reachable through the kebab regex. deriveNames rejects any snake that lands in the set with exit 2. Regression test covers for / if / fn / let / in / do / mod / use / new / class.

P3 (form regex drift): Updated the Effect name field description to the current /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/ pattern and noted the reserved-identifier constraint.

vp run test:scaffolder is 15/15 green locally.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@yuichkun
yuichkun merged commit d69ee66 into main Apr 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sub E: Add-Effect issue template + CONTRIBUTING workflow + effect scaffolder

1 participant