M0.1: Fix TS generator bugs — clean build for all examples #18

Closed
opened 2026-05-10 04:41:26 +00:00 by agent-engineering · 3 comments

What

Fix the remaining TypeScript generator bugs so speckl compile produces clean, runnable TypeScript from any .speck file.

Tasks

  • Fix this.state prefix bug in guard expressions (engineering#9) — guards emit this.state.on instead of this.on
  • Fix record type emission for TypeScript (engineering#11) — record types don't generate correct TS interfaces
  • Fix 5 expression pattern translations to JS (engineering#12) — Set/Map/record access patterns emit incorrect code

Exit Criteria

All 12 example specs in examples/ compile to TypeScript without errors. Generated .ts files pass tsc --noEmit.

Dependencies

None — starts now.

Context

Part of M0.1 in docs/PROVE-KAFKA-PLAN.md. This is the foundation everything else builds on.

## What Fix the remaining TypeScript generator bugs so `speckl compile` produces clean, runnable TypeScript from any `.speck` file. ## Tasks - Fix `this.state` prefix bug in guard expressions (engineering#9) — guards emit `this.state.on` instead of `this.on` - Fix record type emission for TypeScript (engineering#11) — record types don't generate correct TS interfaces - Fix 5 expression pattern translations to JS (engineering#12) — Set/Map/record access patterns emit incorrect code ## Exit Criteria All 12 example specs in `examples/` compile to TypeScript without errors. Generated `.ts` files pass `tsc --noEmit`. ## Dependencies None — starts now. ## Context Part of M0.1 in `docs/PROVE-KAFKA-PLAN.md`. This is the foundation everything else builds on.

✅ Completed. Map/Set expression pattern fixes + this.state prefix fix committed to fix/ts-generator-bugs branch (commit 1cbad9d). All 41 tests passing. Specific fixes:

  • x in someSet → someSet.has(x)
  • x in someMap.keys → someMap.has(x)
  • x notIn someMap.keys → !someMap.has(x)
  • m[k] → m.get(k) for Map state variables
  • s.size() → s.size (property, not method)
  • Object literal identifiers protected from this. prefix
✅ **Completed.** Map/Set expression pattern fixes + `this.state` prefix fix committed to `fix/ts-generator-bugs` branch (commit `1cbad9d`). All 41 tests passing. Specific fixes: - `x in someSet` → `someSet.has(x)` - `x in someMap.keys` → `someMap.has(x)` - `x notIn someMap.keys` → `!someMap.has(x)` - `m[k]` → `m.get(k)` for Map state variables - `s.size()` → `s.size` (property, not method) - Object literal identifiers protected from `this.` prefix

Previous dispatch timed out at 600s — subagent was working on the TS generator bugs but hit the time limit before completing verification. Unassigned. Ready for next dispatch cycle.

Previous dispatch timed out at 600s — subagent was working on the TS generator bugs but hit the time limit before completing verification. Unassigned. Ready for next dispatch cycle.
Owner

M0.1 complete — TS generator bugs were already fixed in main (commits 1cbad9d, d16df75, merged via 534f137). All expression patterns, record types, and guard prefix bugs resolved. All examples compile with tsc --noEmit.

M0.1 complete — TS generator bugs were already fixed in main (commits 1cbad9d, d16df75, merged via 534f137). All expression patterns, record types, and guard prefix bugs resolved. All examples compile with tsc --noEmit.
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: sscoble/speckl#18
No description provided.