speckl/compiler
Scott Scoble a6bdbce915 feat(speckl): event_suffix directive + static-field reset (cycle 61)
Adds 'event_suffix: "Payload"' as a top-of-file directive. When set,
the .proto generator appends the suffix to every 'event' block's
emitted message name. Default (no directive) preserves the existing
'event CreateGroup' → 'message CreateGroup' behavior.

Why: federated-meetup's handwritten proto names every transition
payload CreateGroupPayload, AddStewardPayload, etc. (the convention
that the wrapper message carries a 'Payload' suffix and the event
type lives in 'oneof payload { ... }'). Without this directive, the
Speckl-generated proto would emit 'message CreateGroup' and the
consumer Go code would fail to find the types it imports.

The test fixture uses three tests:
  - directive parsed and stored on SpeckNode
  - directive absent → eventSuffix undefined
  - both quoted ("Payload") and bare (Payload) values accepted

The reset of (parseSpeck as any)._protoPackage / _goPackage /
_eventSuffix at the start of parseSpeck fixes a pre-existing
static-field-hack leak where a previous test's metadata would
persist into the next test's parse. Documented as a known
anti-pattern in spec-compiler-dogfood SKILL.md; full cleanup
to a local-object pattern is tracked separately. The minimum
fix here is 'reset at start of parse' which restores test
isolation without refactoring the entire metadata-collection
path.

End-to-end verified: running generateProtobuf against a speck
with event_suffix: "Payload" emits 'message CreateGroupPayload'
and 'message AddStewardPayload' (correct).

All 52 tests pass. tsc build clean.

Reference: .hermes/skills/spec-compiler-dogfood/references/
  speckl-federated-meetup-protobuf-migration.md — the migration
unblocks when every generated message name matches what the
consumer's Go imports expect.
2026-06-28 22:02:12 -07:00
..
__tests__ feat(speckl): event_suffix directive + static-field reset (cycle 61) 2026-06-28 22:02:12 -07:00
dist feat(protobuf): honor speck.protoPackage and speck.goPackage overrides 2026-06-28 21:49:19 -07:00
node_modules TS generator: fix #12 (5 expression patterns) + #11 (opaque record types) 2026-05-11 10:16:15 -07:00
out/speckl-compile feat(compiler): self-hosting spec + generator multi-enum support 2026-05-03 14:42:03 -07:00
specs feat(compiler): self-hosting spec + generator multi-enum support 2026-05-03 14:42:03 -07:00
src feat(speckl): event_suffix directive + static-field reset (cycle 61) 2026-06-28 22:02:12 -07:00
test-output TS generator: fix #12 (5 expression patterns) + #11 (opaque record types) 2026-05-11 10:16:15 -07:00
test-output-rust/TigerBeetleLedger feat(rust): Rust codegen backend (speckl#24) 2026-05-09 23:24:40 -07:00
.gitignore Add .gitignore for compiler dependencies and build artifacts 2026-04-29 15:12:37 -07:00
.last-build fix: add dist-check guard + List<T> type parsing + state machine examples 2026-05-05 03:11:53 -07:00
check-dist.sh fix: add dist-check guard + List<T> type parsing + state machine examples 2026-05-05 03:11:53 -07:00
package-lock.json WASM E2E test: Speckl specs compile to runnable WebAssembly 2026-05-03 13:13:55 -07:00
package.json WASM E2E test: Speckl specs compile to runnable WebAssembly 2026-05-03 13:13:55 -07:00
tsconfig.json Add SpeckDL compiler scaffold 2026-04-29 15:12:08 -07:00